Skip to content

Instantly share code, notes, and snippets.

View mgillam's full-sized avatar

Mic mgillam

View GitHub Profile
@mgillam
mgillam / cors_server.py
Created November 15, 2016 01:15 — forked from enjalot/cors_server.py
Allow CORS with python simple http server
import SimpleHTTPServer
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied
to the outputfile by the caller unless the command was HEAD,
and must be closed by the caller under all circumstances), or