Skip to content

Commit

Permalink
RockefellerArchiveCenter#207: Update CORS_ORIGIN_ALLOW_ALL
Browse files Browse the repository at this point in the history
  • Loading branch information
ctgraham committed Aug 18, 2022
1 parent 05a65fc commit 9e9c747
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions argo/config.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ SQL_USER = "postgres" # name of the application database user (string)
SQL_PASSWORD = "postgres" # password for the application database (string)
SQL_HOST = "argo-db" # host for the application database (string)
SQL_PORT = 5432 # port on which the application database can be reached (integer)
USE_X_FORWARDED_HOST=True # Whether the application is behind a reverse proxy
USE_X_FORWARDED_PORT=True # Whether the application is behind a reveres proxy on another port (e.g. HTTPS?)
SECURE_PROXY_SSL_HEADER=['HTTP_X_FORWARDED_PROTO', 'https'] # What header should be considered to respond with HTTPS urls
DJANGO_CORS_ALLOW_ALL_ORIGINS=False # Legacy (risky) setting to allow all CORS origins
DJANGO_CORS_ALLOWED_ORIGINS=["http://localhost", "http://localhost:3000"] # A list of allowed CORS origins

3 changes: 2 additions & 1 deletion argo/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@
}

# CORS settings
CORS_ORIGIN_ALLOW_ALL = True
CORS_ALLOW_ALL_ORIGINS = config.DJANGO_CORS_ALLOW_ALL_ORIGINS
CORS_ALLOWED_ORIGINS = config.DJANGO_CORS_ALLOWED_ORIGINS

DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'

0 comments on commit 9e9c747

Please sign in to comment.