Fix SIGSEGV in httpclient response body (#16766)

* initialize httpclient response bodyStream; prevent SIGSEGV when getBody is false

* Update lib/pure/httpclient.nim

* Update lib/pure/httpclient.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
Daehee
2021-01-22 07:04:52 -07:00
committed by GitHub
parent bebfbaa439
commit 2d0cb18b9f
2 changed files with 12 additions and 4 deletions

View File

@@ -148,6 +148,12 @@ proc syncTest() =
client.close()
# SIGSEGV on HEAD body read: issue #16743
block:
let client = newHttpClient()
let resp = client.head("http://httpbin.org/head")
doAssert(resp.body == "")
when false:
# Disabled for now because it causes troubles with AppVeyor
# Timeout test.