Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Commit

Permalink
fix Access-Control-Expose-Headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ozee31 committed Dec 21, 2018
1 parent 68ad815 commit 0cf7ee0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Routing/Middleware/CorsMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ public function __invoke(ServerRequestInterface $request, ResponseInterface $res
->withHeader('Access-Control-Allow-Origin', $this->_allowOrigin($request))
->withHeader('Access-Control-Allow-Credentials', $this->_allowCredentials())
->withHeader('Access-Control-Max-Age', $this->_maxAge())
->withHeader('Access-Control-Allow-Headers', $this->_allowHeaders($request))
->withHeader('Access-Control-Allow-Methods', $this->_allowMethods())
->withHeader('Access-Control-Expose-Headers', $this->_exposeHeaders());
->withHeader('Access-Control-Expose-Headers', $this->_exposeHeaders())
;

if (strtoupper($request->getMethod()) === 'OPTIONS') {
$response = $response
->withHeader('Access-Control-Allow-Headers', $this->_allowHeaders($request))
->withHeader('Access-Control-Allow-Methods', $this->_allowMethods())
;
return $response;
}
}
Expand Down

0 comments on commit 0cf7ee0

Please sign in to comment.