mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-17 10:13:56 -05:00
Merge pull request #3218 from ikaruswill/fix/issue-3214
Fix: ALLOWED_HOSTS logic being overwritten when * is set
This commit is contained in:
commit
d2a8076596
@ -322,8 +322,7 @@ You can read more about this in [the Django project's documentation](https://doc
|
|||||||
|
|
||||||
Can also be set using PAPERLESS_URL (see above).
|
Can also be set using PAPERLESS_URL (see above).
|
||||||
|
|
||||||
If manually set, please remember to include "localhost". Otherwise
|
"localhost" is always allowed for docker healthcheck
|
||||||
docker healthcheck will fail.
|
|
||||||
|
|
||||||
Defaults to "\*", which is all hosts.
|
Defaults to "\*", which is all hosts.
|
||||||
|
|
||||||
|
@ -422,11 +422,12 @@ if _paperless_url:
|
|||||||
_paperless_uri = urlparse(_paperless_url)
|
_paperless_uri = urlparse(_paperless_url)
|
||||||
CSRF_TRUSTED_ORIGINS.append(_paperless_url)
|
CSRF_TRUSTED_ORIGINS.append(_paperless_url)
|
||||||
CORS_ALLOWED_ORIGINS.append(_paperless_url)
|
CORS_ALLOWED_ORIGINS.append(_paperless_url)
|
||||||
if ["*"] != ALLOWED_HOSTS:
|
|
||||||
|
if ["*"] != ALLOWED_HOSTS:
|
||||||
|
# always allow localhost. Necessary e.g. for healthcheck in docker.
|
||||||
|
ALLOWED_HOSTS.append("localhost")
|
||||||
|
if _paperless_url:
|
||||||
ALLOWED_HOSTS.append(_paperless_uri.hostname)
|
ALLOWED_HOSTS.append(_paperless_uri.hostname)
|
||||||
else:
|
|
||||||
# always allow localhost. Necessary e.g. for healthcheck in docker.
|
|
||||||
ALLOWED_HOSTS = [_paperless_uri.hostname] + ["localhost"]
|
|
||||||
|
|
||||||
# For use with trusted proxies
|
# For use with trusted proxies
|
||||||
TRUSTED_PROXIES = __get_list("PAPERLESS_TRUSTED_PROXIES")
|
TRUSTED_PROXIES = __get_list("PAPERLESS_TRUSTED_PROXIES")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user