Beispiel #1
0
 private function checkOrigin(Request $request)
 {
     if ($this->options['allowedOrigins'] === true) {
         // allow all '*' flag
         return true;
     }
     $origin = $request->headers->get('Origin');
     foreach ($this->options['allowedOrigins'] as $allowedOrign) {
         if (OriginMatcher::matches($allowedOrign, $origin)) {
             return true;
         }
     }
     return false;
 }
 /**
  * @dataProvider matchesDataProvider
  */
 public function testMatches($pattern, $origin, $matches)
 {
     $this->assertSame($matches, OriginMatcher::matches($pattern, $origin));
 }