Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Http-Fundation] HeaderUtils->combine breaks X-Sendfile #28627

Copy link
Copy link
Closed
@Alsatian67

Description

@Alsatian67
Issue body actions

Symfony versions affected: >= 4.1 only

Description
This commit broke the X-SendFile mecanism.

Due to the HeaderUtils::combine() (precedently named HeaderUtils::combineParts()) function, here $pathPrefix is converted to lower case.

If the real path contains upper case characters, it don't work anymore.

Possible Solution
Cancel the commit changes in BinaryFileResponse.
(compare with substr(strtolower($path), 0, \strlen($pathPrefix) is not a solution on unix systems)

Additional context
Example of Nginx configuration which wont work (because "John" starts with an uppercase character) :

 location ~ ^/index\.php(/|$) {
        fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;

        ...

        fastcgi_param  HTTP_X-Sendfile-Type     X-Accel-Redirect;
        fastcgi_param  HTTP_X-Accel-Mapping    /home/John/=/protected_files/;

        internal;
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.