From de408ebd93c97c13d086c8a145c4d7c2d46d0ad8 Mon Sep 17 00:00:00 2001 From: LukeAI <43993778+LukeAI@users.noreply.github.com> Date: Mon, 27 Jan 2020 17:10:20 +0000 Subject: [PATCH] Update base.py Modification necessary for using CVAT from remote machines when accessing with FQDNs See https://github.com/opencv/cvat/issues/1011#issue-542817055 This might just be a hacky workaround, compensating for a bug in proper parsing of the URL "I believe the reason for this is that sometimes if the port number is :80 and the URL is not in the LAN (:port), but instead it is a Fully Qualified Domain Name (:port), the port 80 is redundant (mydomain.com:80) and the errors arise." --- cvat/settings/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cvat/settings/base.py b/cvat/settings/base.py index 08ae7e2b4e0d..b15466dac795 100644 --- a/cvat/settings/base.py +++ b/cvat/settings/base.py @@ -192,10 +192,11 @@ def generate_ssh_keys(): CORS_ALLOW_CREDENTIALS = True CSRF_TRUSTED_ORIGINS = [UI_HOST] UI_URL = '{}://{}'.format(UI_SCHEME, UI_HOST) +UI_WITHOUT_PORT = UI_URL if len(UI_URL): UI_URL += ':{}'.format(UI_PORT) -CORS_ORIGIN_WHITELIST = [UI_URL] +CORS_ORIGIN_WHITELIST = [UI_URL, UI_WITHOUT_PORT] CORS_REPLACE_HTTPS_REFERER = True STATICFILES_FINDERS = [