Servers that supports CORS?

3.8k views Asked by At

I wonder if there are many servers that are supporting CORS?

3

There are 3 answers

1
Magmatic On BEST ANSWER

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 "*"'); ?>

0
Bastien On

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

0
Adam B On

Tomcat users can use the CORS Filter