Skip to content

Instantly share code, notes, and snippets.

@caisui
Created December 14, 2013 13:48
Show Gist options
  • Save caisui/7959322 to your computer and use it in GitHub Desktop.
Save caisui/7959322 to your computer and use it in GitHub Desktop.
from http.server import SimpleHTTPRequestHandler, test
class CSPHTTPRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Content-Security-Policy', "default-src 'self'")
super(CSPHTTPRequestHandler, self).end_headers()
if __name__ == '__main__':
test(HandlerClass=CSPHTTPRequestHandler)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment