-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
ParseFile upload with javasctipt creating Access-Control-Allow-Origin #118
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
Comments
I solved it by using the following.
|
@samarthagarwal But this can be used as a temporary solution. The exact solution would be adding a middleware Response Header in the files.js itself. I tried to give a solution but unable to understand the flow. |
@skavinvarnan Would you like to submit a PR? |
@samarthagarwal - Could you pls suggest file name and location to enable CORS with above fix? not sure where exactly i need to apply fix on parse-server thank you |
This should be working in #390 and will be in 2.1.3 (or you can pull master.) Please open a new issue if you still have problems. Thanks. |
Fix assets with incorrect routes
When i tried to upload a file to parse-server using this documentation its throwing an error Access-Control-Allow-Origin.
Digging more into the request and response i found that the below Response Header is missing out these
Access-Control-Allow-Headers:*
Access-Control-Allow-Methods:GET,PUT,POST,DELETE,OPTIONS
Access-Control-Allow-Origin:*
I tried saving a ParseObject using this documentation In that response i do get the above Response Headers and everything works fine
Note: I tried to upload the ParseFile with the same code to Parse Main server and everything worked fine. I also got the Response Header as * for Access-Control-Allow-Headers and Methods
I found a comment in files.js
// TODO: do we need to allow crossdomain and method override?
I think my problem will be solved when crossdomain is added
Environment:
node version: 4.2.4
parse-server version: 2.0.3
The text was updated successfully, but these errors were encountered: