Skip to content

PHP FPM - both HTTP_CONTENT_TYPE and CONTENT_TYPE are set. #37

@chris114782

Description

@chris114782

Platform: PHP 8.0.3 (FPM) / NGINX 1.18.0 / linux
riverline/multipart-parser: 2.0.8

When using the PHP FPM behind NGINX (although this should be the case for any CGI based consumer) $_SERVER has both HTTP_CONTENT_TYPE and CONTENT_TYPE indexes set, as well as both HTTP_CONTENT_LENGTH and CONTENT_LENGTH indexes.

This means that when Riverline\MultiPartParser\Converters\Globals::convert() is called the stream sent to the StreamedPart constructor contains 2 content-type headers, and results in an array when StreamedPart parses it.

Unfortunately the parseHeaderContent() method calls explode() on the content without checking if it's an array and fails.

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