Skip to content

Instantly share code, notes, and snippets.

View leifdenby's full-sized avatar
🌍

Leif Denby leifdenby

🌍
View GitHub Profile
@leifdenby
leifdenby / httpcors
Created January 16, 2021 13:13 — forked from gkatsev/httpcors
simple python3 http server with CORS enabled
#!/usr/bin/env python
import http.server
class CORSHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def send_head(self):
"""Common code for GET and HEAD commands.
This sends the response code and MIME headers.
Return value is either a file object (which has to be copied