summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authornarimiran <narimiran@disroot.org>2020-04-07 16:32:07 +0200
committerDominik Picheta <dominikpicheta@googlemail.com>2020-04-07 22:21:39 +0100
commit3036ec9c4456f6a5edb0a5bbfbb3e3c79fba7d23 (patch)
tree6c508eb711b9419ff9eb8274b3c2b36fae1688a5 /lib
parentc835c8c4e78cbe3451c2ccdfffe9663f1b428728 (diff)
downloadNim-3036ec9c4456f6a5edb0a5bbfbb3e3c79fba7d23.tar.gz
fix #13894, httpclient hang on Http204
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/httpclient.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/httpclient.nim b/lib/pure/httpclient.nim
index e3e5a5c11..5c53c1a39 100644
--- a/lib/pure/httpclient.nim
+++ b/lib/pure/httpclient.nim
@@ -818,7 +818,7 @@ proc parseResponse(client: HttpClient | AsyncHttpClient,
   if not fullyRead:
     httpError("Connection was closed before full request has been made")
 
-  if getBody:
+  if getBody and result.code != Http204:
     when client is HttpClient:
       client.bodyStream = newStringStream()
       result.bodyStream = client.bodyStream
9'>139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176