im trying to use jquery file upload to post files to a fileserver written in tornado. while i can post a file to the same domain i have issues if my fileserver is on a different domain or a subdomain of the origin. lets say from mydomain.com to files.mydomain.com
on the tornado web handler i set up an OPTIONS and a POST handler. the options function looks like this:
def options(self):
self.set_header('Access-Control-Allow-Origin', '*')
self.set_header('Access-Control-Allow-Methods', 'POST, OPTIONS')
self.set_header('Access-Control-Max-Age', 1000)
self.set_header('Access-Control-Allow-Headers', '*')
self.set_status(200)
in the console i get a
XMLHttpRequest cannot load http://files.mycomain.com/upload. Origin http://mydomain.com is not allowed by Access-Control-Allow-Origin.
but the response shows that the Access-Control-Allow-Origin header is set to *.
how can i make this thing work?