chatgpt-your-files
chatgpt-your-files copied to clipboard
Script SRC and embedding error -- Cross-Origin Resource Sharing (CORS)
Bug report
Describe the bug
How do I enable Cross-Origin Resource Sharing (CORS) ? When I upload, the script isn't embedding, and when I try to chat I keep getting this script-src error
A clear and concise description of what the bug is. can't get this to give me a response due to this error
The Content Security Policy (CSP) prevents the evaluation of arbitrary strings as JavaScript to make it more difficult for an attacker to inject unathorized code on your site. To solve this issue, avoid using eval(), new Function(), setTimeout([string], ...) and setInterval([string], ...) for evaluating strings. If you absolutely must: you can enable string evaluation by adding unsafe-eval as an allowed source in a script-src directive. ⚠️ Allowing string evaluation comes at the risk of inline script injection. 1 directive Source location Directive Status script-src blocked
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Go to '…'
- Click on '…'
- Scroll down to '…'
- See error
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: [e.g. macOS, Windows]
- Mac OS X
- Browser (if applies) [e.g. chrome, safari]
- Brave
- Version of supabase-js: [e.g. 6.0.2]
- Version of Node.js: [e.g. 10.10.0]
Additional context
Add any other context about the problem here.
Having the same issue. @autogro-ai Did you ever find a solution ?
Hi @autogro-ai and @Toby-exe. Can you confirm that you are returning CORS headers in your edge function responses as defined here: https://github.com/supabase-community/chatgpt-your-files/blob/2bb8afb723c85a672e845be148842e442d0f9d3b/supabase/functions/chat/index.ts#L15-L19
and returned here: https://github.com/supabase-community/chatgpt-your-files/blob/2bb8afb723c85a672e845be148842e442d0f9d3b/supabase/functions/chat/index.ts#L23-L25
and here: https://github.com/supabase-community/chatgpt-your-files/blob/2bb8afb723c85a672e845be148842e442d0f9d3b/supabase/functions/chat/index.ts#L127
Few days late 😂, I've moved on from this project. Thanks though
No problem, and sorry for the delay. I'll close this for now - if anyone else encounters something similar please feel free to open a new issue.