Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

SimpleHTTPServer subclass that sends custom headers

View serve.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#!/usr/bin/env python
import SimpleHTTPServer
 
class MyHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def end_headers(self):
self.send_my_headers()
 
SimpleHTTPServer.SimpleHTTPRequestHandler.end_headers(self)
 
def send_my_headers(self):
self.send_header("Access-Control-Allow-Origin", "*")
 
 
if __name__ == '__main__':
SimpleHTTPServer.test(HandlerClass=MyHTTPRequestHandler)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.