From 7d0ed3d926e0f0e80bd0f3141c5217ffe54358a8 Mon Sep 17 00:00:00 2001 From: hboie Date: Fri, 9 Oct 2020 17:16:36 -0400 Subject: [PATCH] bugfix: when the server doesn't send the "Continue" keyword in the "HTTP/1.1 100" header, this header will not be stripped correctly. Then also the rest of the header will not be stripped correctly, but ends up in the response_body, which causes an expection when trying to convert the JSON data of the response_body. --- src/Jaspersoft/Tool/RESTRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Jaspersoft/Tool/RESTRequest.php b/src/Jaspersoft/Tool/RESTRequest.php index 2ad536a..945bec8 100644 --- a/src/Jaspersoft/Tool/RESTRequest.php +++ b/src/Jaspersoft/Tool/RESTRequest.php @@ -260,7 +260,7 @@ protected function doExecute (&$curlHandle) $response = curl_exec($curlHandle); $this->response_info = curl_getinfo($curlHandle); - $response = preg_replace("/^(?:HTTP\/1.1 100 Continue.*?\\r\\n\\r\\n)+/ms", "", $response); + $response = preg_replace("/^(?:HTTP\/1.1 100.*?\\r\\n\\r\\n)+/ms", "", $response); // 100-continue chunks are returned on multipart communications $headerblock = strstr($response, "\r\n\r\n", true);