Skip to content

Instantly share code, notes, and snippets.

@patrickhulce
Created February 18, 2015 04:16
Show Gist options
  • Save patrickhulce/9d13dcfa2b1d65c722a5 to your computer and use it in GitHub Desktop.
Save patrickhulce/9d13dcfa2b1d65c722a5 to your computer and use it in GitHub Desktop.
304 Dummy Server
from wsgiref.simple_server import WSGIServer, WSGIRequestHandler
def echo(environ, start_response):
status = "304 Not Modified"
headers = [("Content-type", "application/json"), ("ETag", "asdf")]
start_response(status, headers)
return [""]
httpd = WSGIServer(('0.0.0.0', 80), WSGIRequestHandler)
httpd.set_app(echo)
httpd.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment