TinyWebServer
TinyWebServer copied to clipboard
CORS Header
How can I send header: Access-Control-Allow-Origin: * ?
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.