Skip to content

Instantly share code, notes, and snippets.

@noelrocha
Created June 8, 2017 16:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save noelrocha/d8c0cb2602c0b5ecda662269d598c04a to your computer and use it in GitHub Desktop.
Save noelrocha/d8c0cb2602c0b5ecda662269d598c04a to your computer and use it in GitHub Desktop.
python server loggin headers
#!/usr/bin/env python
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def do_GET(self):
logging.error(self.headers)
SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
Handler = GetHandler
httpd = SocketServer.TCPServer(("", PORT), Handler)
httpd.serve_forever()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment