Servers supporting CORS?

I wonder if there are many servers that support CORS?

+5
source share
3 answers

Making your web server support CORS is as simple as making it return a different header.

For example, in Apache2, just add this line to the corresponding conf file:

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

To be more secure (or if you donโ€™t have access to your serverโ€™s conf conf file), you can NOT add this header to your server, but only add it using server-side code when you really want to.

For example, in PHP you can do this: (untested)

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

+8
source

Tomcat users can use CORS Filter

+2
source

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

0
source

All Articles