Example #1
0
 /**
  * @CORS
  * @expectedException \OC\AppFramework\Middleware\Security\SecurityException
  */
 public function testCorsIgnoredIfWithCredentialsHeaderPresent()
 {
     $request = new Request(['server' => ['HTTP_ORIGIN' => 'test']], $this->getMock('\\OCP\\Security\\ISecureRandom'), $this->getMock('\\OCP\\IConfig'));
     $this->reflector->reflect($this, __FUNCTION__);
     $middleware = new CORSMiddleware($request, $this->reflector, $this->session);
     $response = new Response();
     $response->addHeader('AcCess-control-Allow-Credentials ', 'TRUE');
     $middleware->afterController($this, __FUNCTION__, $response);
 }
 /**
  * @CORS
  * @expectedException \OC\AppFramework\Middleware\Security\SecurityException
  */
 public function testCorsIgnoredIfWithCredentialsHeaderPresent()
 {
     $request = new Request(array('server' => array('HTTP_ORIGIN' => 'test')));
     $this->reflector->reflect($this, __FUNCTION__);
     $middleware = new CORSMiddleware($request, $this->reflector);
     $response = new Response();
     $response->addHeader('AcCess-control-Allow-Credentials ', 'TRUE');
     $response = $middleware->afterController($this, __FUNCTION__, $response);
 }