8000 [Http-Fundation] HeaderUtils->combine breaks X-Sendfile · Issue #28627 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
[Http-Fundation] HeaderUtils->combine breaks X-Sendfile #28627
Closed
@Alsatian67

Description

@Alsatian67

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

      0