DELETE requests should always have a content-length header
Not having DELETE in this list is causing hanging when trying to close webdriver sessions in [halonium](https://github.com/halonium/halonium/issues/10) and likely any other implementation of the webdriver protocol. Both at least chromedriver and geckodriver are affected by this issue.
This commit is contained in:
parent
d34d023da1
commit
944a0ac318
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)
|
||||
elif httpMethod in ["POST", "PATCH", "PUT"] or body.len != 0:
|
||||
elif httpMethod in ["POST", "PATCH", "PUT", "DELETE"] 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