zulip/zproject
Alex Vandiver cc9b028312 uploads: Set X-Accel-Redirect manually, without using django-sendfile2.
The `django-sendfile2` module unfortunately only supports a single
`SENDFILE` root path -- an invariant which subsequent commits need to
break.  Especially as Zulip only runs with a single webserver, and
thus sendfile backend, the functionality is simple to inline.

It is worth noting that the following headers from the initial Django
response are _preserved_, if present, and sent unmodified to the
client; all other headers are overridden by those supplied by the
internal redirect[^1]:
 - Content-Type
 - Content-Disposition
 - Accept-Ranges
 - Set-Cookie
 - Cache-Control
 - Expires

As such, we explicitly unset the Content-type header to allow nginx to
set it from the static file, but set Content-Disposition and
Cache-Control as we want them to be.

[^1]: https://www.nginx.com/resources/wiki/start/topics/examples/xsendfile/
2023-01-09 18:23:58 -05:00
..
jinja2 requirements: Upgrade Python requirements. 2022-07-05 17:54:17 -07:00
__init__.py
backends.py ruff: Fix ISC003 Explicitly concatenated string. 2023-01-04 16:25:07 -08:00
computed_settings.py uploads: Set X-Accel-Redirect manually, without using django-sendfile2. 2023-01-09 18:23:58 -05:00
config.py config: Remove Django base class from ZulipSettingsError. 2022-09-26 12:42:36 -07:00
configured_settings.py ruff: Fix M001 Unused `noqa` directive. 2022-11-03 12:10:15 -07:00
default_settings.py uploads: Set X-Accel-Redirect manually, without using django-sendfile2. 2023-01-09 18:23:58 -05:00
dev_settings.py uploads: Set X-Accel-Redirect manually, without using django-sendfile2. 2023-01-09 18:23:58 -05:00
dev_urls.py typing: Fix function signatures with django-stubs. 2021-08-20 06:02:55 -07:00
email_backends.py email_backends: Fix type annotation of EmailLogBackEnd. 2022-07-29 14:58:11 -07:00
legacy_urls.py legacy_urls: Add type annotation to legacy_urls. 2022-08-12 17:08:04 -07:00
prod_settings.pyi lint: Replace pycodestyle and pyflakes with ruff. 2022-11-03 12:10:15 -07:00
prod_settings_template.py rate_limit: Add interface to override rate limiting rules. 2022-11-08 08:56:42 -08:00
sentry.py requirements: Upgrade Python requirements. 2022-06-01 16:01:54 -07:00
settings.py ruff: Fix M001 Unused `noqa` directive. 2022-11-03 12:10:15 -07:00
settings_types.py settings_type: Extract new module for types used in settings. 2022-09-26 12:42:36 -07:00
template_loaders.py template_loaders: Extract TwoFactorLoader to new module. 2022-09-26 12:42:36 -07:00
test_extra_settings.py settings_type: Extract new module for types used in settings. 2022-09-26 12:42:36 -07:00
test_settings.py ruff: Fix M001 Unused `noqa` directive. 2022-11-03 12:10:15 -07:00
urls.py apps: Fix redirect from /apps -> https://zulip.com/apps/. 2022-12-30 17:47:16 -08:00
wsgi.py python: Normalize quotes with Black. 2021-02-12 13:11:19 -08:00