From a3177209b652587fa2a5a20edbd11b499347a01d Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 28 Dec 2018 19:22:51 +0000 Subject: [PATCH] httpclient : reset the parameters when all the content is get (to allow the redirect to work correctely) git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@4816 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- httpclient.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/httpclient.php b/httpclient.php index f6b235f..44f258e 100644 --- a/httpclient.php +++ b/httpclient.php @@ -543,7 +543,7 @@ class Httpclient $cookies = $this->cookieToSend ($this->url); if (! empty ($cookies)) { - $this->headersSent[] = "Cookie: ".implode ("; ", $cookies); + $this->headersSent["Cookie"] = implode ("; ", $cookies); } if ($this->method !== "GET" && ! empty ($this->formData)) { @@ -730,6 +730,9 @@ class Httpclient $content = gzdecode ($content); } $this->disconnect (); + $this->headersReset (); + $this->formData = ""; + $this->rawData = ""; if ($this->httpCode === 301 || $this->httpCode === 302 || key_exists ("Location", $this->headersReceived)) {