Skip to content

Navigation Menu

Sign in
Appearance settings

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

Commit 28e67c5

Browse filesBrowse files
committed
X-Accel-Mapping does not use HTTP key=value syntax
1 parent 0e47775 commit 28e67c5
Copy full SHA for 28e67c5

File tree

Expand file treeCollapse file tree

2 files changed

+4
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+4
-3
lines changed

‎src/Symfony/Component/HttpFoundation/BinaryFileResponse.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/BinaryFileResponse.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,8 +219,8 @@ public function prepare(Request $request)
219219
// Do X-Accel-Mapping substitutions.
220220
// @link http://wiki.nginx.org/X-accel#X-Accel-Redirect
221221
$parts = HeaderUtils::split($request->headers->get('X-Accel-Mapping', ''), ',=');
222-
$mappings = HeaderUtils::combine($parts);
223-
foreach ($mappings as $pathPrefix => $location) {
222+
foreach ($parts as $part) {
223+
[$pathPrefix, $location] = $part;
224224
if (substr($path, 0, \strlen($pathPrefix)) === $pathPrefix) {
225225
$path = $location.substr($path, \strlen($pathPrefix));
226226
break;

‎src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/HttpFoundation/Tests/BinaryFileResponseTest.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,8 @@ public function getSampleXAccelMappings()
337337
{
338338
return array(
339339
array('/var/www/var/www/files/foo.txt', '/var/www/=/files/', '/files/var/www/files/foo.txt'),
340-
array('/home/foo/bar.txt', '/var/www/=/files/,/home/foo/=/baz/', '/baz/bar.txt'),
340+
array('/home/Foo/bar.txt', '/var/www/=/files/,/home/Foo/=/baz/', '/baz/bar.txt'),
341+
array('/home/Foo/bar.txt', '"/var/www/"="/files/", "/home/Foo/"="/baz/"', '/baz/bar.txt'),
341342
);
342343
}
343344

0 commit comments

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