开发者

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

Is there a way to set custom headers of responses to static file 开发者_运维技巧requests?

E.g. I'd want to set Access-Control-Allow-Origin: * when serving static files.


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


You can't; the only thing you can do is to stream these static files adding the Access-Control-Allow-Origin header to the Response.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜