[Ficus] Enable CORS headers http referee replace and middleware - #138
Merged
melvinsoft merged 2 commits intoJul 18, 2017
Merged
Conversation
Author
tkeemon
reviewed
Jul 18, 2017
| # removing the database alias | ||
| del DATABASES['appsembler_usage'] | ||
|
|
||
| if FEATURES.get('ENABLE_CORS_HEADERS'): |
There was a problem hiding this comment.
Same as my comment in the other PR:
Let's set a default value for this get method in case it's not correctly set in the env:
FEATURES.get('ENABLE_CORS_HEADERS', False)
Author
|
@tkeemon Same as the other PR: Thanks for reviewing this, I've added the default for the settings, and also I've removed the middleware, I know is recommended, but not mandatory, and breaking the external requests again, and working without it, so I think we can remove it. |
OmarIthawi
pushed a commit
that referenced
this pull request
Aug 11, 2018
EDUCATOR-3206: Fix chemical equations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR includes settings to allow us to use CORS headers requests when we're running under HTTPS. When we're using django-cors-headers properly configured, we're able to retrieve the csrf external cookie, but when we want to make a POST request from the external domain is working under HTTP but not under HTTPS since the referer is passed, and is blocked if it's external.
See the Django's docs (point 4)
In Django 1.9 a new settings has been added to allow to set the white listed domains that can make request, but since this settings is not available until Django 1.9, we need to use the django-cors-headers workaround.