Skip to content

Commit

Permalink
Update base.py
Browse files Browse the repository at this point in the history
Modification necessary for using CVAT from remote machines when accessing with FQDNs
See cvat-ai#1011 (comment)

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 (<HOST-IP>:port), but instead it is a Fully Qualified Domain Name (<FQDN>:port), the port 80 is redundant (mydomain.com:80) and the errors arise."
  • Loading branch information
LukeAI authored Jan 27, 2020
1 parent 095d6d4 commit de408eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cvat/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit de408eb

Please sign in to comment.