Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If authorization is not of type Bearer to ignore it and check the cookie #318

Closed
2 tasks done
cberescu opened this issue Dec 6, 2023 · 1 comment · Fixed by #325
Closed
2 tasks done

If authorization is not of type Bearer to ignore it and check the cookie #318

cberescu opened this issue Dec 6, 2023 · 1 comment · Fixed by #325
Labels
good first issue Good for newcomers

Comments

@cberescu
Copy link
Contributor

cberescu commented Dec 6, 2023

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

I think it would help for the authorization header to be skipped if it is not Bearer type. No reason to throw an error if it is not the expected format.
Easies way to do it is to change this line
if ((request.headers && request.headers.authorization) && (!onlyCookie))
into
if ((request.headers && request.headers.authorization) && (!onlyCookie) && (/^Bearer/i.test(request.headers.authorization)))

Motivation

A good example is if you are using also the Basic auth on the same domain.

Example

No response

@mcollina
Copy link
Member

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants