mirror of
https://github.com/nextcloud/passman.git
synced 2024-09-20 14:56:21 +08:00
Check HTTP_ORIGIN using isset
This commit is contained in:
parent
ff349ac6b0
commit
f8c13471b7
|
@ -17,9 +17,8 @@ class APIMiddleware extends Middleware {
|
|||
|
||||
public function afterController($controller, $methodName, Response $response) {
|
||||
if($response instanceof JSONResponse){
|
||||
$origin = $this->request->server['HTTP_ORIGIN'];
|
||||
if($origin) {
|
||||
$response->addHeader('Access-Control-Allow-Origin', $origin);
|
||||
if(isset($this->request->server['HTTP_ORIGIN'])) {
|
||||
$response->addHeader('Access-Control-Allow-Origin', $this->request->server['HTTP_ORIGIN']);
|
||||
}
|
||||
}
|
||||
return parent::afterController($controller, $methodName, $response);
|
||||
|
|
Loading…
Reference in a new issue