Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
oser-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hamza Touizrat
oser-backend
Commits
3b2ed5aa
Commit
3b2ed5aa
authored
Apr 9, 2018
by
florimondmanca
Browse files
Options
Downloads
Patches
Plain Diff
restrict CORS to whitelisted hosts
parent
fc85474c
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
oser_backend/oser_backend/settings/common.py
+11
-1
11 additions, 1 deletion
oser_backend/oser_backend/settings/common.py
with
11 additions
and
1 deletion
oser_backend/oser_backend/settings/common.py
+
11
−
1
View file @
3b2ed5aa
...
...
@@ -116,7 +116,17 @@ REST_FRAMEWORK = {
}
# Security
CORS_ORIGIN_ALLOW_ALL
=
True
CORS_ORIGIN_REGEX_WHITELIST
=
(
# Allow local hosts on any port
r
'
^(https?://)?localhost(:\d+)?$
'
,
r
'
^(https?://)?127\.0\.0\.1(:\d+)?$
'
,
# Allow hosts such as:
# - https://oser-cs.herokuapp.com
# - https://oser-frontend-dev.herokuapp.com
# (but also https://unknown.herokuapp.com...)
# Essentially allows any frontend hosted on Heroku to send CORS requests.
r
'
^(https?://)?(.+\.)?herokuapp\.com$
'
)
X_FRAME_OPTIONS
=
'
DENY
'
# refuse to serve in an <iframe>
# Pymdown-extensions Emoji configuration
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment