Don't add content-length header on GET request when there is no body. (#16196)
* Don't add content-length header on GET request when there is no body. * Add space between the not and the (. * Take Dom's suggestion.
This commit is contained in:
parent
ae9fe2b2f9
commit
cabfc7ec5c
1 changed files with 1 additions and 1 deletions
|
|
@ -980,7 +980,7 @@ proc requestAux(client: HttpClient | AsyncHttpClient, url, httpMethod: string,
|
|||
var data: seq[string]
|
||||
if multipart != nil and multipart.content.len > 0:
|
||||
data = await client.format(multipart)
|
||||
else:
|
||||
elif httpMethod in ["POST", "PATCH", "PUT"] or body.len != 0:
|
||||
client.headers["Content-Length"] = $body.len
|
||||
|
||||
when client is AsyncHttpClient:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue