Skip to content

Commit

Permalink
Merge pull request tpyo#118 from ad-m/patch-1
Browse files Browse the repository at this point in the history
Case in-sensitive header comparision
  • Loading branch information
tpyo authored May 5, 2019
2 parents 3506fdd + 1aaf151 commit 62ae202
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions S3.php
Original file line number Diff line number Diff line change
Expand Up @@ -2501,15 +2501,16 @@ private function __responseHeaderCallback($curl, $data)
$data = trim($data);
if (strpos($data, ': ') === false) return $strlen;
list($header, $value) = explode(': ', $data, 2);
if ($header == 'Last-Modified')
$header = strtolower($header);
if ($header == 'last-modified')
$this->response->headers['time'] = strtotime($value);
elseif ($header == 'Date')
elseif ($header == 'date')
$this->response->headers['date'] = strtotime($value);
elseif ($header == 'Content-Length')
elseif ($header == 'content-length')
$this->response->headers['size'] = (int)$value;
elseif ($header == 'Content-Type')
elseif ($header == 'content-type')
$this->response->headers['type'] = $value;
elseif ($header == 'ETag')
elseif ($header == 'etag')
$this->response->headers['hash'] = $value{0} == '"' ? substr($value, 1, -1) : $value;
elseif (preg_match('/^x-amz-meta-.*$/', $header))
$this->response->headers[$header] = $value;
Expand Down

0 comments on commit 62ae202

Please sign in to comment.