Skip to content

BWS around auth-params equal sign is not parsed correctly #158

@lieryan

Description

@lieryan

The syntax for auth-param of an Authorization header according to RFC 7235 Section 2.1 is:

auth-param     = token BWS "=" BWS ( token / quoted-string )

and that recipient MUST parse for such bad whitespace and remove it before interpreting the protocol element.

However webob doesn't remove the BWS (bad whitespace) around the equal sign:

In [1]: parse_auth_params('a= "2", b=3 , c =4')
Out[1]: {'a': ' "2', 'b': '3 '}

Expected behavior:

In [2]: parse_auth_params('a= "2", b=3 , c =4')
Out[2]: {'a': '2', 'b': '3', 'c': '4'}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions