ovidiucp / TinyWebServer

Small web server for Arduino, fits in 10KB ROM, less than 512 bytes RAM
http://www.webweavertech.com/ovidiu/weblog/archives/000484.html
GNU Lesser General Public License v2.1
245 stars 65 forks source link

CORS Header #30

Open kadu opened 8 years ago

kadu commented 8 years ago

How can I send header: Access-Control-Allow-Origin: * ?

ovidiucp commented 8 years ago

The method that lets you do that is not appropriately named, but still does what you want:

web_server.send_content_type("Access-Control-Allow-Origin: *");

You'd need to place that line in your custom handler function. In the SimpleWebServer example you would put that linke in index_handler(), just before the end_headers() call.