Content-Security-Policy: How to set this up to use this prototype with a FastAPI backend? #613
Unanswered
quandanrepo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am enjoying used this Design System for prototyping but recently, I have set up a Python FastAPI backend to interact with some python specific models. However, I am running into a Content-Security-Policy error, when trying to use fetch to reach a GET endpoint:
On Firefox:
Content-Security-Policy: The page's settings blocked the loading of a resource at http://localhost:8000/endpoint ("connect-src")
On Chrome:
Refused to connect to 'http://localhost:8000/endpoint' because it violates the following Content Security Policy directive: "connect-src 'self'"
For the python backend, I had enabled CORS middleware, and allowed all origins, headers and methods. I have tested this backend with a basic create-react-app , and there seems to be no issue.
I have tried to add a meta tag into Helmet component of the page, including the exact endpoint to be part of the Content-Security-Policy but no luck in getting around this error.
Any help would be much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions