coto / gae-boilerplate

Google App Engine Boilerplate
https://dev-dot-sandengine.appspot.com/
Other
685 stars 189 forks source link

How to enable CORS with gae-boilerplate? #311

Open yoderjen opened 9 years ago

yoderjen commented 9 years ago

I'm trying to use the boilerplate code to hook up a user authentication/login system for an already existing web app. Since they'll have different domains, I need to enable CORS in the appengine handlers.
According to http://enable-cors.org/server_appengine.html , I can do this with the line self.response.headers.add_header("Access-Control-Allow-Origin", "*") in the handlers. But I've tried adding it to the end of the base handler (bp_includes/lib/basehandler.py), which didn't work, and also in the handlers for user registration (bp_includes/handlers.py), which also didn't work.

Where should I add the CORS headers?

kishore-narendran commented 9 years ago

If I am not mistaken it has to be added to every single handler?