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
Changes from 1 commit
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
Prev Previous commit
Allow lowercase http/2 content-type header
  • Loading branch information
glensc committed Sep 5, 2019
commit 1dc316f60eab28599bcd9be65bdc880152e6091a
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