Skip to content

content-types that start with 'application/x-www-form-urlencoded' should not be treated as multi-part #18

Open
@moocher

Description

@moocher

The request() method in the Client class in oauth2/__init__py has this statement:

is_multipart = method == 'POST' and headers.get('Content-Type', DEFAULT_CONTENT_TYPE) != DEFAULT_CONTENT_TYPE

This means that content-types like "application/x-www-form-urlencoded; charset=utf-8" will make is_multipart evaluate to True. Can it be changed to something like this please?

is_multipart = method == 'POST' and not headers.get('Content-Type', DEFAULT_CONTENT_TYPE).startswith(DEFAULT_CONTENT_TYPE)

Thanks

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions