-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
CrossDomain request, normal GET, POST, OPTIONS etc. works, but upload not #319
Comments
Can you post here the request AND response content of the OPTIONS and POST requests for regular successful xhr and OPTIONS and POST for the upload? |
Successful OPTIONS and POST request:
POST
Failed Upload POST request (successful OPTIONS)
Somehow I try to recreate the issue, it resolves itself... I don't know how. Before I change my code to try to upload it to same-origin so that I can continue my development, and everything works fine. Now I revert to the old issue, but somehow everything works. Well I guess thanks then. But just for my own knowledge, is there any differences between the POST request of a normal form and multipart encoded form? Could it create this kind of issue like before? |
No it should be the same as normal xhr. The only restriction is IE8-9 flash polyfill which does not allow custom headers so you need to find another way to send the auth headers within the request. |
Is 'Authorization' header for Bearer token counted as a custom header? |
Yep, you cannot set |
You would also need crsoodomain.xml file on your server. Read the readme file CORS and server section. |
Okay thanks a lot, @danialfarid . I'll take a look at it and I will let you know if there seems to be any other issue. |
Please open separate issue since this issue is working for you now. |
As you can see I try 3 XHR before uploading. All uses the
$http
service from Angular, and they are routed to the domainapi.aurora.dev
from the originaurora.dev
. All works and the preflight request also handle fine, I use Laravel 4.2 as back-end and using thebarryvdh/laravel-cors
package for handling CORS. All seems to work fine, until I try doing upload.This is the script below, do I need to add extra header for upload request? Is it different then normal POST or PUT request? Thank you.
Btw everything works fine if I do it with same domain stuff. Thank you.
The text was updated successfully, but these errors were encountered: