On za, 2014-05-24 at 10:19 -0700, Clavier wrote: > Hi, > > I am testing my application from local files, and it runs nicely in > IE10, but not in FireFox 29 due to Same Origin Policy. It seems that > FireFox doesn't recognize the local client (file:///E:/chatGui.html) > and the local server (http://localhost:8888/server) as the same > origin.
That is correct. Neither does chrome. > > So, I applied CORS(Cross-Origin Resource Sharing) protocol to the > local host (Tornado server), but I see no difference: > > class BaseHandler(tornado.web.RequestHandler): > def set_default_headers(self): > self.set_header("Access-Control-Allow-Origin", '*') > self.set_header("Access-Control-Allow-Credentials", 'true') > self.set_header("Access-Control-Allow-Methods", > "GET,PUT,POST,DELETE,OPTIONS") > self.set_header("Access-Control-Allow-Headers", "Content-Type, > Depth, User-Agent, X-File-Size, X-Requested-With, X-Requested-By, > If-Modified-Since, X-File-Name, Cache-Control") > > > Do I have to make some change in the client side too? > > Thanks in advnace. I think it's primarily a client "problem". So, probably yes. But I'm not sure. I would handle the cross-origin with a local server (simple python webserver) that serves all files. Or, when it's partial local an partial remote, with apache (reverse proxy for the remote) or nginx. That way all requests go tho the same target and all content comes from the same origin. -- --- You received this message because you are subscribed to the Google Groups "Pyjs.org Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to pyjs-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.