From 8a0c302142ee8b3aeaca298e1233fc8d77187136 Mon Sep 17 00:00:00 2001 From: Jeroen Stolp Date: Mon, 6 Jan 2020 11:55:28 +0100 Subject: [PATCH] Adding Content-Length: 0 Head on PUT start transaction call --- src/SignhostClient.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/SignhostClient.php b/src/SignhostClient.php index 36423b4..95f52ed 100644 --- a/src/SignhostClient.php +++ b/src/SignhostClient.php @@ -90,7 +90,12 @@ public function performRequest(string $endpoint, string $method, $data = null, $ if ("GET" === $method || "HEAD" === $method && !isset($filePath)) { unset($headers[0]); // unset Content-Type } - + + // for start transaction, SignHost will require the content-lenth: 0 header. + if (false !== strpos($endpoint, 'start')) { + $headers[] = "Content-Length: 0"; + } + // Initialize a cURL session return $this->performCURLRequest( $method,