We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cbb869b commit 9afdaa5Copy full SHA for 9afdaa5
http/web.py
@@ -63,9 +63,15 @@ async def send_file(writer, file):
63
async def server(reader, writer):
64
req = await reader.readline()
65
print(req)
66
- method, uri, proto = req.split(b" ")
67
- m = re.match(url_pat, uri)
68
- route_req = m.group(5)
+ try:
+ method, uri, proto = req.split(b" ")
+ m = re.match(url_pat, uri)
69
+ route_req = m.group(5)
70
+ except Exception as e:
71
+ print("Malformed request: {}".format(req))
72
+ writer.close
73
+ await writer.close()
74
+ return
75
76
while True:
77
h = await reader.readline()
0 commit comments