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
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)