Skip to content

Empty Bearer token results in unhandled exception #1496

Open
@Tuhin-thinks

Description

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.

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions