Skip to content

Commit

Permalink
Merge pull request #53 from s0l0m0nc/s0l0m0nc-fix-header
Browse files Browse the repository at this point in the history
fix linux/windows header
  • Loading branch information
treeform authored Dec 15, 2021
2 parents 674b582 + 63f62ff commit b70a2c4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/puppy.nim
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ proc fetch*(req: Request): Response =
if line != "":
let parts = line.split(":", 1)
if parts.len == 2:
result.headers[parts[0].strip()] = parts[1].strip()
result.headers.add(Header(key: parts[0].strip(), value: parts[1].strip()))

var i: int
result.body.setLen(8192)
Expand Down Expand Up @@ -433,7 +433,7 @@ proc fetch*(req: Request): Response =
for headerLine in headerData.split(CRLF):
let arr = headerLine.split(":", 1)
if arr.len == 2:
result.headers[arr[0].strip()] = arr[1].strip()
result.headers.add(Header(key: arr[0].strip(), value: arr[1].strip()))
result.body = bodyWrap.str
if result.headers["Content-Encoding"] == "gzip":
try:
Expand Down

0 comments on commit b70a2c4

Please sign in to comment.