Skip to content

Commit

Permalink
insist harder
Browse files Browse the repository at this point in the history
  • Loading branch information
guzba committed Feb 3, 2024
1 parent e96af0e commit 79c3118
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
7 changes: 2 additions & 5 deletions src/puppy/platforms/linux/platform.nim
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,8 @@ proc internalFetch*(req: Request): Response {.raises: [PuppyError].} =
for headerLine in headerData.split(CRLF):
let arr = headerLine.split(":", 1)
if arr.len == 2:
when (NimMajor, NimMinor, NimPatch) >= (1, 4, 8):
result.add((arr[0].strip(), arr[1].strip()))
else:
let tmp = cast[ptr HttpHeaders](result.headers.addr)
tmp[].toBase.add((arr[0].strip(), arr[1].strip()))
let tmp = cast[ptr HttpHeaders](result.headers.addr)
tmp[].toBase.add((arr[0].strip(), arr[1].strip()))

result.body = bodyWrap.str
if result.headers["Content-Encoding"] == "gzip":
Expand Down
7 changes: 2 additions & 5 deletions src/puppy/platforms/win32/platform.nim
Original file line number Diff line number Diff line change
Expand Up @@ -255,11 +255,8 @@ proc internalFetch*(req: Request): Response {.raises: [PuppyError].} =
if line != "":
let parts = line.split(":", 1)
if parts.len == 2:
when (NimMajor, NimMinor, NimPatch) >= (1, 4, 8):
result.add((parts[0].strip(), parts[1].strip()))
else:
let tmp = cast[ptr HttpHeaders](result.headers.addr)
tmp[].toBase.add((parts[0].strip(), parts[1].strip()))
let tmp = cast[ptr HttpHeaders](result.headers.addr)
tmp[].toBase.add((parts[0].strip(), parts[1].strip()))

var i: int
result.body.setLen(8192)
Expand Down

0 comments on commit 79c3118

Please sign in to comment.