Skip to content

Instantly share code, notes, and snippets.

View pfeodrippe's full-sized avatar

Paulo Rafael Feodrippe pfeodrippe

View GitHub Profile
@pfeodrippe
pfeodrippe / cors_server.py
Created March 29, 2016 22:17 — 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