Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

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

Sign up
Appearance settings

Commit557313a

Browse files
committed
Updating HTTP header parsing
1 parenta945431 commit557313a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

‎Services/Zencoder.php

Lines 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
returnTRUE;
233233
}
234-
if (empty($headers['Content-Type'])) {
234+
if (empty($headers['content-type'])) {
235235
thrownewServices_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

Lines 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_linesas$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)

[8]ページ先頭

©2009-2025 Movatter.jp