Handle failed uri parsing in asynchttpserver (#6374)

This commit is contained in:
superfunc
2017-09-15 01:41:12 -07:00
committed by Andreas Rumpf
parent 9aeb78e2a8
commit bca3bedc47

View File

@@ -178,7 +178,12 @@ proc processClient(client: AsyncSocket, address: string,
except ValueError:
asyncCheck request.respondError(Http400)
continue
of 1: parseUri(linePart, request.url)
of 1:
try:
parseUri(linePart, request.url)
except ValueError:
asyncCheck request.respondError(Http400)
continue
of 2:
try:
request.protocol = parseProtocol(linePart)