New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re-add accidentally removed CORS middleware #2075
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,13 +3,12 @@ | |
from conf.settings.base import INSTALLED_APPS, MIDDLEWARE | ||
|
||
|
||
INSTALLED_APPS += [ | ||
"oauth2_provider", | ||
] | ||
if "oauth2_provider" not in INSTALLED_APPS: | ||
INSTALLED_APPS.append("oauth2_provider") | ||
|
||
MIDDLEWARE += [ | ||
"oauth2_provider.middleware.OAuth2TokenMiddleware", | ||
] | ||
middleware = "oauth2_provider.middleware.OAuth2TokenMiddleware" | ||
if middleware not in MIDDLEWARE: | ||
MIDDLEWARE.append(middleware) | ||
Comment on lines
+6
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to make There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The order is important. For example, the CORS middleware specifies that it should be set as early in the list as possible, hence https://github.com/WordPress/openverse/pull/2075/files#diff-1e4c90df768f3514290795d5e58d3b561644bd37e4dfdb9938b60083dd062d30R45 |
||
|
||
OAUTH2_PROVIDER = { | ||
"SCOPES": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
from conf.settings.base import INSTALLED_APPS | ||
|
||
|
||
INSTALLED_APPS += [ | ||
"api", | ||
] | ||
if "api" not in INSTALLED_APPS: | ||
INSTALLED_APPS.append("api") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the comment, did we actually want to remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't try to understand or change this bit. It was added by @zackkrida in #945.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this enables the middleware which lets us log all DB queries, so we should keep it!