diff --git a/README.md b/README.md
index 1c82fd4..eaba01f 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)
@@ -125,7 +136,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";
@@ -241,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.
diff --git a/Services/Zencoder.php b/Services/Zencoder.php
index ba8e209..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
@@ -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);
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/"
}
]
}