Skip to content

Commit

Permalink
Fixed headers for ServerRequest.
Browse files Browse the repository at this point in the history
  • Loading branch information
debuss committed Aug 21, 2019
1 parent 3ad168a commit a47699e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -11,7 +11,8 @@
],
"require": {
"psr/http-message": "^1.0",
"psr/http-factory": "^1.0"
"psr/http-factory": "^1.0",
"ralouphie/getallheaders": "3.0.3"
},
"autoload": {
"psr-4": {
Expand Down
9 changes: 9 additions & 0 deletions src/Http/ServerRequest.php
Expand Up @@ -50,6 +50,15 @@ public function __construct(string $method, $uri, array $server = null)
$this->attributes = [];

$this->uploaded_files = Helper::getUploadedFilesFromGlobal();

foreach (getallheaders() as $header => $value) {
$header = trim((string)$header);
if (!isset($this->headers[$header])) {
$this->headers[$header] = [];
}

$this->headers[$header] = array_merge($this->headers[$header], $value);
}
}

/**
Expand Down

0 comments on commit a47699e

Please sign in to comment.