mirror of
https://github.com/kalmarek/SmallHyperbolic
synced 2024-11-27 08:30:27 +01:00
rm http_server.py
This commit is contained in:
parent
8f295b8bc6
commit
8555393004
@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
# encoding: utf-8
|
|
||||||
"""Use instead of `python3 -m http.server` when you need CORS"""
|
|
||||||
|
|
||||||
from http.server import HTTPServer, SimpleHTTPRequestHandler
|
|
||||||
|
|
||||||
class CORSRequestHandler(SimpleHTTPRequestHandler):
|
|
||||||
def end_headers(self):
|
|
||||||
self.send_header('Access-Control-Allow-Origin', '*')
|
|
||||||
self.send_header('Access-Control-Allow-Methods', 'GET')
|
|
||||||
self.send_header('Cache-Control', 'no-store, no-cache, must-revalidate')
|
|
||||||
return super(CORSRequestHandler, self).end_headers()
|
|
||||||
|
|
||||||
|
|
||||||
httpd = HTTPServer(('localhost', 8003), CORSRequestHandler)
|
|
||||||
httpd.serve_forever()
|
|
Loading…
Reference in New Issue
Block a user