Skip to content

Conversation

@frederikprijck
Copy link
Member

@frederikprijck frederikprijck commented Apr 1, 2025

We want to return as 401, instead of a 400 in the case where the request has no authorization header.
When there is a malformed authorization header, we still return a 400.

@frederikprijck frederikprijck marked this pull request as draft April 10, 2025 21:06
ommitHeaderDetails = false
) => {
const headerValue = ommitHeaderDetails
? `Bearer`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually have to have an auth-param component here in order for the www-authenticate to be valid as per its definition.

This can the form of WWW-Authenticate: Bearer realm="${currentUrlOrSomeArbitraryIdentifier}"

@evilstreak
Copy link

Is this still planned? I started using this plugin today, and was surprised to get a 400 back rather than a 401 when no auth headers were sent. Would be great to see this change in a release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants