mirror of
https://github.com/nextcloud/passman.git
synced 2024-11-10 17:27:40 +08:00
fix middleware location and namespace
This commit is contained in:
parent
3c5555c7f2
commit
3a91a6b84b
2 changed files with 4 additions and 2 deletions
|
@ -4,7 +4,7 @@ namespace OCA\Passman\Middleware;
|
|||
|
||||
use OCP\AppFramework\Http\JSONResponse;
|
||||
use OCP\AppFramework\Http\Response;
|
||||
use \OCP\AppFramework\Middleware;
|
||||
use OCP\AppFramework\Middleware;
|
||||
use OCP\IRequest;
|
||||
|
||||
class APIMiddleware extends Middleware {
|
||||
|
@ -19,7 +19,9 @@ class APIMiddleware extends Middleware {
|
|||
if($response instanceof JSONResponse){
|
||||
if(isset($this->request->server['HTTP_ORIGIN'])) {
|
||||
$response->addHeader('Access-Control-Allow-Origin', $this->request->server['HTTP_ORIGIN']);
|
||||
}
|
||||
} else {
|
||||
$response->addHeader('Access-Control-Allow-Origin', '*');
|
||||
}
|
||||
}
|
||||
return parent::afterController($controller, $methodName, $response);
|
||||
}
|
Loading…
Reference in a new issue