开发者

Servers that supports CORS?

I wonder if there ar开发者_JAVA百科e many servers that are supporting CORS?


To make your web server support CORS, it is as easy as making it return another header.

For example, in Apache2, simply add this line to your applicable conf file:

Header set Access-Control-Allow-Origin "*"

To be more secure (or if you don't have access to your server's conf file) you might want to NOT add this header in your server, but only add it with your server-side code when you really want it there.

For example in PHP you could do this: (untested)

<? header('Access-Control-Allow-Origin "*"'); ?>


Tomcat users can use the CORS Filter


You can find here a simple implementation of a Python 2.7 server supporting CORS

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜