Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping#31604
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…ccel-MappingCurrently BinaryFileResponse, when configured with X-Accel-Redirect sendfile type,will only substitute file paths specified in X-Accel-Mapping. But if the providedfile path does not have a defined prefix, then the resulting header will includethe absolute path. Nginx expects a valid URI, therefore this will result in anissue that is very hard to detect and debug as it will not show up in error logsand instead the request would just hang for some time and then be re-servedwithout query parameters(?).
fabpot commentedMay 28, 2019
Don't we have the same issue in 3.4? |
vilius-g commentedMay 28, 2019
Yes, this affects all versions. But fix requires refactor for 3.4. |
fabpot commentedMay 28, 2019
@vilius-g It means that we first need a PR on 3.4. Can you work on one? |
vilius-g commentedMay 28, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
OK, I can make this for 3.4. |
fabpot commentedMay 28, 2019
Thank you! |
nicolas-grekas commentedMay 29, 2019
Replaced by#31654 |
…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.4Commits-------a662f61 [HttpFoundation] Do not set X-Accel-Redirect for paths outside of X-Accel-Mapping
Currently
BinaryFileResponse, when configured withX-Accel-Redirectsendfile type, will only substitute file paths specified inX-Accel-Mapping. But if the provided file path does not have a defined prefix, then the resulting header will include 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 will be re-served without query parameters(?).