From 8098579c84f7da2e5d3bbc4766d8602bb8fe1c16 Mon Sep 17 00:00:00 2001 From: Nickolas Malovanets Date: Wed, 23 Oct 2024 19:10:54 +0300 Subject: [PATCH 1/6] Hydrate call can receive a 100-continue header. --- Model/Http/Client/Command/Client/Curl.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Model/Http/Client/Command/Client/Curl.php b/Model/Http/Client/Command/Client/Curl.php index 2146cca..0fbbaef 100644 --- a/Model/Http/Client/Command/Client/Curl.php +++ b/Model/Http/Client/Command/Client/Curl.php @@ -87,6 +87,13 @@ protected function makeRequest($method, $uri, $params = []) if ($err) { $this->doError(curl_error($this->_ch)); } + $httpCode = curl_getinfo($this->_ch, CURLINFO_HTTP_CODE); + if ($httpCode == 100) { + $this->_responseBody = curl_exec($this->_ch); + $httpCode = curl_getinfo($this->_ch, CURLINFO_HTTP_CODE); + } + + $this->_responseStatus = $httpCode; curl_close($this->_ch); } } From d0ea99d952c4ac55d4cebbd4a81d049b8d2c0526 Mon Sep 17 00:00:00 2001 From: Nickolas Malovanets Date: Wed, 23 Oct 2024 19:21:28 +0300 Subject: [PATCH 2/6] Hydrate call can receive a 100-continue header. --- Model/Http/Client/Command/Client/Curl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Model/Http/Client/Command/Client/Curl.php b/Model/Http/Client/Command/Client/Curl.php index 0fbbaef..ed49a7b 100644 --- a/Model/Http/Client/Command/Client/Curl.php +++ b/Model/Http/Client/Command/Client/Curl.php @@ -53,6 +53,7 @@ protected function makeRequest($method, $uri, $params = []) $this->curlOption(CURLOPT_URL, $uri); $this->curlOption(CURLOPT_CUSTOMREQUEST, $method); $this->curlOption(CURLOPT_POSTFIELDS, $params); + $this->curlOption(CURLOPT_HTTPHEADER, ['Expect:']); if (count($this->_headers)) { $heads = []; foreach ($this->_headers as $k => $v) { From 36a590e9a58ed48819ca74d6f77ececc8d09e518 Mon Sep 17 00:00:00 2001 From: Nickolas Malovanets Date: Wed, 23 Oct 2024 19:23:18 +0300 Subject: [PATCH 3/6] Hydrate call can receive a 100-continue header. --- Model/Http/Client/Command/Client/Curl.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Model/Http/Client/Command/Client/Curl.php b/Model/Http/Client/Command/Client/Curl.php index ed49a7b..3b6108a 100644 --- a/Model/Http/Client/Command/Client/Curl.php +++ b/Model/Http/Client/Command/Client/Curl.php @@ -91,6 +91,10 @@ protected function makeRequest($method, $uri, $params = []) $httpCode = curl_getinfo($this->_ch, CURLINFO_HTTP_CODE); if ($httpCode == 100) { $this->_responseBody = curl_exec($this->_ch); + $err = curl_errno($this->_ch); + if ($err) { + $this->doError(curl_error($this->_ch)); + } $httpCode = curl_getinfo($this->_ch, CURLINFO_HTTP_CODE); } From 1403db6e7ab6666c44ec8f0a53bbc2ebb6274454 Mon Sep 17 00:00:00 2001 From: Nickolas Malovanets Date: Wed, 23 Oct 2024 19:27:10 +0300 Subject: [PATCH 4/6] Hydrate call can receive a 100-continue header. --- Model/Http/Client/Command/Client/Curl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Model/Http/Client/Command/Client/Curl.php b/Model/Http/Client/Command/Client/Curl.php index 3b6108a..3eb7db8 100644 --- a/Model/Http/Client/Command/Client/Curl.php +++ b/Model/Http/Client/Command/Client/Curl.php @@ -53,7 +53,6 @@ protected function makeRequest($method, $uri, $params = []) $this->curlOption(CURLOPT_URL, $uri); $this->curlOption(CURLOPT_CUSTOMREQUEST, $method); $this->curlOption(CURLOPT_POSTFIELDS, $params); - $this->curlOption(CURLOPT_HTTPHEADER, ['Expect:']); if (count($this->_headers)) { $heads = []; foreach ($this->_headers as $k => $v) { @@ -61,6 +60,7 @@ protected function makeRequest($method, $uri, $params = []) } $this->curlOption(CURLOPT_HTTPHEADER, $heads); } + $this->curlOption(CURLOPT_HTTPHEADER, ['Expect:']); if (count($this->_cookies)) { $cookies = []; foreach ($this->_cookies as $k => $v) { From e6db4c8a8ed1111289463467aca48b843543e588 Mon Sep 17 00:00:00 2001 From: Nickolas Malovanets Date: Wed, 23 Oct 2024 19:33:34 +0300 Subject: [PATCH 5/6] Hydrate call can receive a 100-continue header. --- Model/Http/BoldClient.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Model/Http/BoldClient.php b/Model/Http/BoldClient.php index 3469e30..b14d046 100644 --- a/Model/Http/BoldClient.php +++ b/Model/Http/BoldClient.php @@ -170,6 +170,7 @@ private function getHeaders(int $websiteId): array 'Content-Type' => 'application/json', 'User-Agent' => $this->userAgent->getUserAgentData(), 'Bold-API-Version-Date' => self::BOLD_API_VERSION_DATE, + 'Expect' => '', ]; } From 14f506d7affd2f0274188e77bb282141c3659088 Mon Sep 17 00:00:00 2001 From: Nickolas Malovanets Date: Wed, 23 Oct 2024 19:33:51 +0300 Subject: [PATCH 6/6] Hydrate call can receive a 100-continue header. --- Model/Http/Client/Command/Client/Curl.php | 1 - 1 file changed, 1 deletion(-) diff --git a/Model/Http/Client/Command/Client/Curl.php b/Model/Http/Client/Command/Client/Curl.php index 3eb7db8..34b9985 100644 --- a/Model/Http/Client/Command/Client/Curl.php +++ b/Model/Http/Client/Command/Client/Curl.php @@ -60,7 +60,6 @@ protected function makeRequest($method, $uri, $params = []) } $this->curlOption(CURLOPT_HTTPHEADER, $heads); } - $this->curlOption(CURLOPT_HTTPHEADER, ['Expect:']); if (count($this->_cookies)) { $cookies = []; foreach ($this->_cookies as $k => $v) {