something was wrong: the server needed updates

This commit is contained in:
Mark McIntyre 2019-05-02 13:21:39 -04:00
parent c631ed31bf
commit 399e7bd0d6

View File

@ -19,8 +19,8 @@ WEB_DIR = '/tmp/web'
class SimpleHandler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
#log.info(f"server version: {self.server_version}")
#log.info(f"client address: {self.client_address}")
log.info(f"server version: {self.server_version}")
log.info(f"client address: {self.client_address}")
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
@ -28,14 +28,14 @@ class SimpleHandler(http.server.BaseHTTPRequestHandler):
return
class SuperSimpleHandler(http.server.SimnpleHTTPRequestHandler):
class SuperSimpleHandler(http.server.SimpleHTTPRequestHandler):
def __init__(self, *args, **kwargs):
super().__init__(*args, directory=WEB_DIR, **kwargs)
def do_GET(self):
#log.info(f"server version: {self.server_version}")
#log.info(f"client address: {self.client_address}")
log.info(f"server version: {self.server_version}")
log.info(f"client address: {self.client_address}")
self.send_response(200)
self.send_header('Content-type', 'text/html')
self.end_headers()
@ -46,8 +46,8 @@ class SockHandler(socketserver.BaseRequestHandler):
def handle(self):
self.data = self.request.recv(1024).strip()
#log.info(f"client address: {self.client_address}")
#log.info(f"received data:\n{self.data}")
log.info(f"client address: {self.client_address}")
log.info(f"received data:\n{self.data}")
self.request.sendall(b"Hello, World!\n")