Fix #5611
This commit is contained in:
parent
316b680f5d
commit
009277856e
1 changed files with 2 additions and 2 deletions
|
|
@ -320,7 +320,7 @@ proc parseResponse(s: Socket, getBody: bool, timeout: int): Response =
|
||||||
if line[linei] != ':': httpError("invalid headers")
|
if line[linei] != ':': httpError("invalid headers")
|
||||||
inc(linei) # Skip :
|
inc(linei) # Skip :
|
||||||
|
|
||||||
result.headers[name] = line[linei.. ^1].strip()
|
result.headers.add(name, line[linei.. ^1].strip())
|
||||||
# Ensure the server isn't trying to DoS us.
|
# Ensure the server isn't trying to DoS us.
|
||||||
if result.headers.len > headerLimit:
|
if result.headers.len > headerLimit:
|
||||||
httpError("too many headers")
|
httpError("too many headers")
|
||||||
|
|
@ -1010,7 +1010,7 @@ proc parseResponse(client: HttpClient | AsyncHttpClient,
|
||||||
if line[linei] != ':': httpError("invalid headers")
|
if line[linei] != ':': httpError("invalid headers")
|
||||||
inc(linei) # Skip :
|
inc(linei) # Skip :
|
||||||
|
|
||||||
result.headers[name] = line[linei.. ^1].strip()
|
result.headers.add(name, line[linei.. ^1].strip())
|
||||||
if result.headers.len > headerLimit:
|
if result.headers.len > headerLimit:
|
||||||
httpError("too many headers")
|
httpError("too many headers")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue