Closed
Description
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;
}