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

fix: Escape URLs when files are served by nginx #1224

Merged
merged 1 commit into from
Oct 6, 2024

Conversation

adamantike
Copy link
Collaborator

When serving files using the X-Accel-Redirect header in nginx, the header values must be URL-encoded. Otherwise, nginx will not be able to serve the files if they contain special characters.

This commit adds a new FileRedirectResponse class to the utils.nginx module, to simplify the creation of responses that serve files using the X-Accel-Redirect header.

Fixes #1212, #1223.

When serving files using the `X-Accel-Redirect` header in nginx, the
header values must be URL-encoded. Otherwise, nginx will not be able
to serve the files if they contain special characters.

This commit adds a new `FileRedirectResponse` class to the `utils.nginx`
module, to simplify the creation of responses that serve files using the
`X-Accel-Redirect` header.

Fixes #1212, #1223.
Copy link

github-actions bot commented Oct 6, 2024

Test Results

81 tests  ±0   81 ✅ ±0   25s ⏱️ +4s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit 60ff832. ± Comparison against base commit cf3932f.

@adamantike adamantike merged commit 0b62fe2 into master Oct 6, 2024
8 checks passed
@adamantike adamantike deleted the fix/escape-download-urls-when-serving-nginx branch October 6, 2024 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants