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

📝 Add note in CORS tutorial about allow_origins with ["*"] and allow_credentials #1895

Merged
merged 1 commit into from
Nov 5, 2020

Conversation

dsmurrell
Copy link
Contributor

Couldn't get credentials working with allow_origins set to ['*']. Thought this might help others.

I was lucky to find this after a while: https://stackoverflow.com/questions/46288437/set-cookies-for-cross-origin-requests

which explains: "Also, make sure the HTTP header Access-Control-Allow-Origin is set and not with a wildcard *."

Specifying some origins, allows my axios request with { withCredentials: true } set to work.

Couldn't get credentials working with `allow_origins` set to `['*']`. Thought this might help others.
@codecov
Copy link

codecov bot commented Aug 14, 2020

Codecov Report

Merging #1895 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##            master     #1895   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          239       239           
  Lines         7079      7079           
=========================================
  Hits          7079      7079           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a689796...b97e74a. Read the comment docs.

@github-actions
Copy link
Contributor

📝 Docs preview for commit b97e74a at: https://5f372bf88c1beb3361110039--fastapi.netlify.app

@tiangolo tiangolo changed the title Update cors.md 📝 Add CORS note about allow_origins with ["*"] and allow_credentials Nov 5, 2020
@tiangolo tiangolo changed the title 📝 Add CORS note about allow_origins with ["*"] and allow_credentials 📝 Add note in CORS tutorial about allow_origins with ["*"] and allow_credentials Nov 5, 2020
@tiangolo tiangolo merged commit 5df00f3 into fastapi:master Nov 5, 2020
@tiangolo
Copy link
Member

tiangolo commented Nov 5, 2020

Good point! Thanks for the contribution @dsmurrell ! 🚀 🍰

And thanks @Kludex for the review ☕

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.

3 participants