Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

Commit

Permalink
https: set the max-age header before the next middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarotero committed May 28, 2016
1 parent fcb5954 commit d604f18
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/Middleware/Https.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,10 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
$request = $request->withUri($uri);
}

$response = $next($request, $response);

if (!empty($this->maxAge)) {
$response = $response->withHeader(self::HEADER, sprintf('max-age=%d%s', $this->maxAge, $this->includeSubdomains ? ';includeSubDomains' : ''));
}

return $response;
return $next($request, $response);
}
}

0 comments on commit d604f18

Please sign in to comment.