Skip to content

Content-Type header check is not case insensitive #10

@noresistence

Description

@noresistence

Steps to reproduce the issue

Manage to get the key content-type instead of Content-Type in $response->headers and send the token as application/json.

Expected result

The token should be identified as application/json in

if (strpos($response->headers['Content-Type'], 'application/json') !== false)

Actual result

The header will not be identified correctly as content-type indicator.

According to RFC 2616 - "Hypertext Transfer Protocol -- HTTP/1.1", Section 4.2, "Message Headers", Field names are case-insensitive.

System information (as much as possible)

Appears on a fresh joomla install from docker image with tag "joomla:3-php7.1", as well as tag "joomla:3-php7.2", and tag "3" as of 17th of march.

Additional comments

Fix it by ensuring the check to be case insensitive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions