Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
chris114782 opened this issue Apr 27, 2021 · 0 comments
Open

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

chris114782 opened this issue Apr 27, 2021 · 0 comments

Comments

@chris114782
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant