mirror of
				https://github.com/nextcloud/passman.git
				synced 2025-10-23 11:56:59 +08:00 
			
		
		
		
	Check HTTP_ORIGIN using isset
This commit is contained in:
		
							parent
							
								
									ff349ac6b0
								
							
						
					
					
						commit
						f8c13471b7
					
				
					 1 changed files with 2 additions and 3 deletions
				
			
		|  | @ -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…
	
	Add table
		
		Reference in a new issue