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

Empty Bearer token results in unhandled exception #1496

Open
2 tasks done
Tuhin-thinks opened this issue Sep 16, 2024 · 1 comment · May be fixed by #1502
Open
2 tasks done

Empty Bearer token results in unhandled exception #1496

Tuhin-thinks opened this issue Sep 16, 2024 · 1 comment · May be fixed by #1502
Labels

Comments

@Tuhin-thinks
Copy link

Describe the bug
If you do not pass the "token" string after Bearer in Authorization header, it will result in an unhandled exception.

To Reproduce
Use django-oauth-toolkit and setup as a Django middleware.
Define any route and register in urls.py

Expected behavior

Version
3.0.1

Tested with

  • I have tested with the latest published release and it's still a problem.
  • I have tested with the master branch and it's still a problem.

Additional context
My request header looks like this:
image

I think problem is in here
It should check if there is space before splitting authheader by space.

Wondering, if you are expecting a PR.

@n2ygk
Copy link
Member

n2ygk commented Sep 16, 2024

Yes a PR would be greatly appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants