From 2940349da7db1bcc1863697617493d9071a77703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 5 Sep 2019 20:03:26 +0300 Subject: [PATCH 1/2] composer: use https urls --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 32bfcb8..c8fcfdd 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "zencoder/zencoder-php", - "homepage": "http://github.com/zencoder/zencoder-php", + "homepage": "https://github.com/zencoder/zencoder-php", "description":"Zencoder integration library for PHP", "keywords":["zencoder", "encoding", "encoder", "cloud"], "type":"library", @@ -16,7 +16,7 @@ "authors":[ { "name":"Zencoder", - "homepage":"http://zencoder.com" + "homepage":"https://zencoder.com" } ] } From 1dc316f60eab28599bcd9be65bdc880152e6091a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Thu, 5 Sep 2019 20:04:55 +0300 Subject: [PATCH 2/2] Allow lowercase http/2 content-type header --- Services/Zencoder.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Services/Zencoder.php b/Services/Zencoder.php index ba8e209..b0b6537 100644 --- a/Services/Zencoder.php +++ b/Services/Zencoder.php @@ -231,9 +231,16 @@ private function _processResponse($response) if ( $status == 204 || (($status == 200 || $status == 201) && trim($body) == "")) { return TRUE; } + + // http/1.0 and http/1.1 if (empty($headers['Content-Type'])) { - throw new Services_Zencoder_Exception('Response header is missing Content-Type', $body); + // http/2 + if (empty($headers['content-type'])) { + throw new Services_Zencoder_Exception('Response header is missing Content-Type', $body); + } + $headers['Content-Type'] = $headers['content-type']; } + switch ($headers['Content-Type']) { case 'application/json': case 'application/json; charset=utf-8':