Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 557313a

Browse filesBrowse files
committed
Updating HTTP header parsing
1 parent a945431 commit 557313a
Copy full SHA for 557313a

File tree

2 files changed

+4
-3
lines changed
Filter options

2 files changed

+4
-3
lines changed

‎Services/Zencoder.php

Copy file name to clipboardExpand all lines: Services/Zencoder.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,10 @@ private function _processResponse($response)
231231
if ( $status == 204 || (($status == 200 || $status == 201) && trim($body) == "")) {
232232
return TRUE;
233233
}
234-
if (empty($headers['Content-Type'])) {
234+
if (empty($headers['content-type'])) {
235235
throw new Services_Zencoder_Exception('Response header is missing Content-Type', $body);
236236
}
237-
switch ($headers['Content-Type']) {
237+
switch ($headers['content-type']) {
238238
case 'application/json':
239239
case 'application/json; charset=utf-8':
240240
return $this->_processJsonResponse($status, $headers, $body);

‎Services/Zencoder/Http.php

Copy file name to clipboardExpand all lines: Services/Zencoder/Http.php
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ public function __call($name, $args) {
115115
array_shift($header_lines);
116116
foreach ($header_lines as $line) {
117117
list($key, $value) = explode(":", $line, 2);
118-
$headers[$key] = trim($value);
118+
// Ensure headers are lowercase per https://tools.ietf.org/html/rfc2616#section-4.2
119+
$headers[strtolower($key)] = trim($value);
119120
}
120121
curl_close($curl);
121122
if (isset($buf) && is_resource($buf)) fclose($buf);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.