diff --git a/README.md b/README.md index 4959b0a..9b0b006 100644 --- a/README.md +++ b/README.md @@ -216,18 +216,20 @@ directory. This script will serve the tree locally. from http.server import HTTPServer, SimpleHTTPRequestHandler import sys - class CORSRequestHandler(SimpleHTTPRequestHandler): - + def end_headers(self): self.send_header('Access-Control-Allow-Origin', '*') - self.send_header('Access-Control-Allow-Methods', '*') - self.send_header('Access-Control-Allow-Headers', '*') + self.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS') + self.send_header('Access-Control-Allow-Headers', 'Content-Type, Authorization') self.send_header('Cache-Control', 'no-store, no-cache, must-revalidate') return super(CORSRequestHandler, self).end_headers() def do_OPTIONS(self): self.send_response(200) + self.send_header('Access-Control-Allow-Origin', '*') + self.send_header('Access-Control-Allow-Methods', 'GET, POST, OPTIONS') + self.send_header('Access-Control-Allow-Headers', 'Content-Type, Authorization') self.end_headers() host = sys.argv[1] if len(sys.argv) > 2 else '0.0.0.0'