Merge pull request #4943 from nigredo-tori/fix-4942
Reset HttpClient if new URL has different port
This commit is contained in:
commit
86ca077324
1 changed files with 4 additions and 2 deletions
|
|
@ -958,8 +958,10 @@ proc parseResponse(client: HttpClient | AsyncHttpClient,
|
||||||
proc newConnection(client: HttpClient | AsyncHttpClient,
|
proc newConnection(client: HttpClient | AsyncHttpClient,
|
||||||
url: Uri) {.multisync.} =
|
url: Uri) {.multisync.} =
|
||||||
if client.currentURL.hostname != url.hostname or
|
if client.currentURL.hostname != url.hostname or
|
||||||
client.currentURL.scheme != url.scheme:
|
client.currentURL.scheme != url.scheme or
|
||||||
if client.connected: client.close()
|
client.currentURL.port != url.port:
|
||||||
|
if client.connected:
|
||||||
|
client.close()
|
||||||
|
|
||||||
when client is HttpClient:
|
when client is HttpClient:
|
||||||
client.socket = newSocket()
|
client.socket = newSocket()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue