File tree 2 files changed +4
-3
lines changed
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -231,10 +231,10 @@ private function _processResponse($response)
231
231
if ( $ status == 204 || (($ status == 200 || $ status == 201 ) && trim ($ body ) == "" )) {
232
232
return TRUE ;
233
233
}
234
- if (empty ($ headers ['Content-Type ' ])) {
234
+ if (empty ($ headers ['content-type ' ])) {
235
235
throw new Services_Zencoder_Exception ('Response header is missing Content-Type ' , $ body );
236
236
}
237
- switch ($ headers ['Content-Type ' ]) {
237
+ switch ($ headers ['content-type ' ]) {
238
238
case 'application/json ' :
239
239
case 'application/json; charset=utf-8 ' :
240
240
return $ this ->_processJsonResponse ($ status , $ headers , $ body );
Original file line number Diff line number Diff line change @@ -115,7 +115,8 @@ public function __call($name, $args) {
115
115
array_shift ($ header_lines );
116
116
foreach ($ header_lines as $ line ) {
117
117
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 );
119
120
}
120
121
curl_close ($ curl );
121
122
if (isset ($ buf ) && is_resource ($ buf )) fclose ($ buf );
You can’t perform that action at this time.
0 commit comments