Skip to content

Instantly share code, notes, and snippets.

@iamdhrooov
Created June 25, 2018 17:56
Show Gist options
  • Save iamdhrooov/403c3316cda86a71fce32ac75bd74dc2 to your computer and use it in GitHub Desktop.
Save iamdhrooov/403c3316cda86a71fce32ac75bd74dc2 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