File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
Expand file tree Collapse file tree 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)
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 );
Original file line number Diff line number Diff 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 );
You can’t perform that action at this time.
0 commit comments