Permalink
Browse files

Headers should win if they are provided when converting Psr7 request …

…to Cake request
  • Loading branch information...
DaVinciEngineer committed Jan 4, 2017
1 parent 1a250ac commit 18e74ac51f707ceecbf268573e23078306aafd53
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/Http/RequestTransformer.php
@@ -41,6 +41,14 @@ public static function toCake(PsrRequest $request)
{
$post = $request->getParsedBody();
$server = $request->getServerParams();
$headers = $request->getHeaders();
foreach ($headers as $k => $value) {
$name = sprintf('HTTP_%s', strtoupper(str_replace('-', '_', $k)));
if (isset($server[$name])) {
$server[$name] = $value[0];
}
}
$files = static::getFiles($request);
if (!empty($files)) {

0 comments on commit 18e74ac

Please sign in to comment.