From 0360517e9a87c5fc1437521bd8762d22b87fd687 Mon Sep 17 00:00:00 2001 From: Jason Cooke Date: Wed, 21 Aug 2019 10:38:10 +1200 Subject: [PATCH 1/5] docs: fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c82fd4..03ec790 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ try { echo "Output ID: ".$encoding_job->outputs['web']->id."\n"; // Store Job/Output IDs to update their status when notified or to check their progress. } catch (Services_Zencoder_Exception $e) { - // If were here, an error occured + // If were here, an error occurred echo "Fail :(\n\n"; echo "Errors:\n"; foreach ($e->getErrors() as $error) echo $error."\n"; From 557313a840de116df5f0ad8823f9a3686d3c29a4 Mon Sep 17 00:00:00 2001 From: Mike Christopher Date: Thu, 5 Sep 2019 10:59:59 -0700 Subject: [PATCH 2/5] Updating HTTP header parsing --- Services/Zencoder.php | 4 ++-- Services/Zencoder/Http.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Services/Zencoder.php b/Services/Zencoder.php index ba8e209..8886970 100644 --- a/Services/Zencoder.php +++ b/Services/Zencoder.php @@ -231,10 +231,10 @@ private function _processResponse($response) if ( $status == 204 || (($status == 200 || $status == 201) && trim($body) == "")) { return TRUE; } - if (empty($headers['Content-Type'])) { + if (empty($headers['content-type'])) { throw new Services_Zencoder_Exception('Response header is missing Content-Type', $body); } - switch ($headers['Content-Type']) { + switch ($headers['content-type']) { case 'application/json': case 'application/json; charset=utf-8': return $this->_processJsonResponse($status, $headers, $body); diff --git a/Services/Zencoder/Http.php b/Services/Zencoder/Http.php index eed8c7d..0a27a95 100644 --- a/Services/Zencoder/Http.php +++ b/Services/Zencoder/Http.php @@ -115,7 +115,8 @@ public function __call($name, $args) { array_shift($header_lines); foreach ($header_lines as $line) { list($key, $value) = explode(":", $line, 2); - $headers[$key] = trim($value); + // Ensure headers are lowercase per https://tools.ietf.org/html/rfc2616#section-4.2 + $headers[strtolower($key)] = trim($value); } curl_close($curl); if (isset($buf) && is_resource($buf)) fclose($buf); From 7e843bbcd18ab8d50ef6134122483d78700a77d7 Mon Sep 17 00:00:00 2001 From: Justin Greer Date: Thu, 5 Sep 2019 13:36:35 -0500 Subject: [PATCH 3/5] 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 f1617a7f89a7422dd8682c276dd644764c4200f8 Mon Sep 17 00:00:00 2001 From: Justin Greer Date: Thu, 5 Sep 2019 13:44:06 -0500 Subject: [PATCH 4/5] Bump version to 2.2.4 --- README.md | 11 +++++++++++ Services/Zencoder.php | 6 +++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 03ec790..13f0f96 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,17 @@ Zencoder API PHP Library ========================== +Company: [Brightcove/Zencoder](http://www.zencoder.com) + +Version: 2.2.4 + +Date: 2019-09-05 + +Repository: + +HTTP headers are handled in a case-insensitve manner so that they are compatible with HTTP2. + + Author: [Nathan Sutton] (nsutton (a) brightcove (.) com) Company: [Brightcove/Zencoder](http://www.zencoder.com) diff --git a/Services/Zencoder.php b/Services/Zencoder.php index 8886970..6e8447c 100644 --- a/Services/Zencoder.php +++ b/Services/Zencoder.php @@ -5,7 +5,7 @@ * @category Services * @package Services_Zencoder * @author Michael Christopher - * @version Release: 2.2.3 + * @version Release: 2.2.4 * @license http://creativecommons.org/licenses/MIT/MIT * @link http://github.com/zencoder/zencoder-php * @access private @@ -26,14 +26,14 @@ function Services_Zencoder_autoload($className) * @category Services * @package Services_Zencoder * @author Michael Christopher - * @version Release: 2.2.3 + * @version Release: 2.2.4 * @license http://creativecommons.org/licenses/MIT/MIT * @link http://github.com/zencoder/zencoder-php */ class Services_Zencoder extends Services_Zencoder_Base { - const USER_AGENT = 'ZencoderPHP v2.2.3'; + const USER_AGENT = 'ZencoderPHP v2.2.4'; /** * Contains the HTTP communication class From ae8ddf9711431f48b2676c3ae4e7342e7bd867ca Mon Sep 17 00:00:00 2001 From: Justin Greer Date: Mon, 9 Sep 2019 13:34:59 -0500 Subject: [PATCH 5/5] Update versions list at bottom of README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 13f0f96..eaba01f 100644 --- a/README.md +++ b/README.md @@ -252,6 +252,7 @@ Your [notifications page](https://app.zencoder.com/notifications) will come in h VERSIONS --------- + Version 2.2.4 - 2019-09-05 HTTP headers are handled in a case-insensitve manner so that they are compatible with HTTP2. Version 2.2.3 - 2014-07-29 Fixed the versions listed in the user agent and throughout the code Version 2.2.2 - 2014-07-29 Fixed a bug where api_key was set as api_version in the http connection options Version 2.2.1 - 2014-07-29 Support setting CURLOPT_CAPATH and CURLOPT_CAINFO on cURL connections.