Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy