Skip to content
This repository was archived by the owner on Aug 12, 2020. It is now read-only.

Cross-Domain POST not working #47

Closed
alsoicode opened this issue Dec 11, 2013 · 5 comments
Closed

Cross-Domain POST not working #47

alsoicode opened this issue Dec 11, 2013 · 5 comments

Comments

@alsoicode
Copy link

When doing a cross-domain POST, an OPTIONS request is issued first. This application does not send a proper response for OPTIONS, thus causing the subsequent POST to fail.

I have this project running on my WebFaction account at: http://uploader.btaylordesign.webfactional.com, and am attempting to post from a static, JavaScript application running in Nginx on my local computer.

@sigurdga
Copy link
Owner

There is nothing special with this POST compared to normal Django posts, as far as I know. Wouldn't you also get into trouble with Django's CSRF protection?

I would suggest: Develop locally and run everything on the same server. I don't see it as necessary functionality for what I try to keep as a minimal example implementation.

I have never needed implementing OPTIONS on either side of the request, and I would doubt the Django project have given too many thoughts about it. So good luck!

@alsoicode
Copy link
Author

Hi. I got it working, but had to write a separate view to return the JSON and headers that jQuery File Upload expects for the GET/OPTIONS and the POST. I'm super-slammed at the moment, but when I get some time I'll share my code.

@sigurdga
Copy link
Owner

Great that you found a solution!

I'll have a look when you post your code :)

@ET-CS
Copy link
Collaborator

ET-CS commented Dec 20, 2013

In the upstream project - the list of already uploaded images are loaded by sending an OPTIONS request to the server. We are implementing it using the GET command. It may be causing the problem mentioned. Maybe it's worth thinking sometime to implement the /view route as in the upstream.
More accurate to the upstream will be to use the same route for the OPTIONS and PUT commands (/server/php in the upstream) and another route for the normal form load - the GET command.

@sigurdga
Copy link
Owner

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants