Skip to content

Instantly share code, notes, and snippets.

@kaleocheng
Created March 29, 2017 03:05
Show Gist options
  • Save kaleocheng/8371c9ce5c5c1bc094f407b3251e8001 to your computer and use it in GitHub Desktop.
Save kaleocheng/8371c9ce5c5c1bc094f407b3251e8001 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python2
from SimpleHTTPServer import SimpleHTTPRequestHandler
import BaseHTTPServer
class CORSRequestHandler (SimpleHTTPRequestHandler):
def end_headers (self):
self.send_header('Access-Control-Allow-Origin', '*')
SimpleHTTPRequestHandler.end_headers(self)
if __name__ == '__main__':
BaseHTTPServer.test(CORSRequestHandler, BaseHTTPServer.HTTPServer)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment