Created
April 11, 2014 00:21
-
-
Save russell/10433991 to your computer and use it in GitHub Desktop.
The worst http server ever
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import SocketServer | |
import SimpleHTTPServer | |
PORT = 8000 | |
class HTTPServer(SimpleHTTPServer.SimpleHTTPRequestHandler): | |
def do_GET(self): | |
self.send_response(400, u"It's a Bad Request") | |
print "serving at port", PORT | |
SocketServer.TCPServer(("", PORT), HTTPServer).serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment