Skip to content

Fix lowercased HTTP headers from HTTP/2 #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion Services/Zencoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -16,7 +16,7 @@
"authors":[
{
"name":"Zencoder",
"homepage":"http://zencoder.com"
"homepage":"https://zencoder.com"
}
]
}