App Engine, Python: setting Access-Control-Allow-Origin (or other headers) for static file responses

Is there a way to set custom response headers for static file requests?

eg. I would like to install Access-Control-Allow-Origin: * when serving static files.

+4
source share
2 answers

Yes, you can.

 - url: /images static_dir: static/images http_headers: X-Foo-Header: foo X-Bar-Header: bar value 

Here is the documentation

https://developers.google.com/appengine/docs/python/config/appconfig#Static_Directory_Handlers

+1
source

You can not; the only thing you can do is transfer these static files by adding the Access-Control-Allow-Origin header in the response.

+1
source

All Articles