jazzband / django-downloadview

Serve files with Django.
https://django-downloadview.readthedocs.io
Other
364 stars 58 forks source link

Preserve headers of original response #205

Open sevdog opened 11 months ago

sevdog commented 11 months ago

When using nginx.XAccelRedirectMiddleware any header which was originally set on the response is lost when the XAccelRedirectResponse is returned.

If any cache related header is meant to be set on per-request basis (ie: Etag) it is lost.

This also happens if using XSendfileResponse/apache.XSendfileMiddleware (since they use the same logic).

It would be nice to have some options to enable these middleware to copy headers from the original response.