Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping #31654

Merged

Conversation

vilius-g
Copy link
Contributor

Q A
Branch? 3.4
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR

#31604 but refactored for 3.4

…ccel-Mapping

Currently BinaryFileResponse, when configured with X-Accel-Redirect sendfile type,
will only substitute file paths specified in X-Accel-Mapping. But if the provided
file path does not have a defined prefix, then the resulting header will include
the absolute path. Nginx expects a valid URI, therefore this will result in an
issue that is very hard to detect and debug as it will not show up in error logs
and instead the request would just hang for some time and then be re-served
without query parameters(?).
@nicolas-grekas
Copy link
Member

Thank you @vilius-g.

@nicolas-grekas nicolas-grekas merged commit a662f61 into symfony:3.4 May 29, 2019
nicolas-grekas added a commit that referenced this pull request May 29, 2019
…side of X-Accel-Mapping (vilius-g)

This PR was merged into the 3.4 branch.

Discussion
----------

[HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

#31604 but refactored for 3.4

Commits
-------

a662f61 [HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping
@vilius-g vilius-g deleted the fix-x-accel-redirect-mismatch-3.4 branch May 29, 2019 12:36
@fabpot fabpot mentioned this pull request May 30, 2019
This was referenced Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants