Skip to content
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

CI: fix Django CSRF error #3994

Merged
merged 13 commits into from
Jul 10, 2023
Merged

CI: fix Django CSRF error #3994

merged 13 commits into from
Jul 10, 2023

Conversation

himdel
Copy link
Collaborator

@himdel himdel commented Jul 10, 2023

looks like django 4 (ansible/galaxy_ng#1753) does more strict origin checking, works with webpack proxy,
but fails with local-web-server on CI:

CSRF Failed: Origin checking failed - http://localhost:8002 does not match any trusted origins.

=> adding PULP_CSRF_TRUSTED_ORIGINS='["http://localhost:8002"]' to CI env
https://docs.djangoproject.com/en/4.0/ref/settings/#csrf-trusted-origins

looks like django 4 does more strict origin checking,
works with webpack proxy,
but fails with local-web-server

adding lws-cors plugin and forcing origin to an expected value

No-Issue
@himdel himdel marked this pull request as draft July 10, 2023 05:47
@himdel himdel changed the title CI: override cors origin to skip Django CSRF error CI: fix Django CSRF error Jul 10, 2023
@himdel himdel marked this pull request as ready for review July 10, 2023 17:01
@himdel himdel merged commit 090d8dd into ansible:master Jul 10, 2023
@himdel himdel deleted the lws-cors branch July 10, 2023 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant