original_string: protected function getAllowedOriginValue(HttpRequest $request)
      {
          $allowedOrigins = $this->options->getAllowedOrigins();
  
          $origin = $request->getHeader('Origin');
  
          if ($origin) {
              $origin = $origin->getFieldValue();
              if (in_array('*', $allowedOrigins)) {
                  return $origin;
              }
              foreach ($allowedOrigins as $allowedOrigin) {
                  if (fnmatch($allowedOrigin, $origin)) {
                      return $origin;
                  }
              }
          }
  
          return 'null';
      }
code: protected function getAllowedOriginValue(HttpRequest $request)
      {
          $allowedOrigins = $this->options->getAllowedOrigins();
  
          $origin = $request->getHeader('Origin');
  
          if ($origin) {
              $origin = $origin->getFieldValue();
              if (in_array('*', $allowedOrigins)) {
                  return $origin;
              }
              foreach ($allowedOrigins as $allowedOrigin) {
                  if (fnmatch($allowedOrigin, $origin)) {
                      return $origin;
                  }
              }
          }
  
          return 'null';
      }
code_tokens: protected function getAllowedOriginValue ( HttpRequest $ request ) { $ allowedOrigins = $ this -> options -> getAllowedOrigins ( ) ; $ origin = $ request -> getHeader ( 'Origin' ) ; if ( $ origin ) { $ origin = $ origin -> getFieldValue ( ) ; if ( in_array ( '*' , $ allowedOrigins ) ) { return $ origin ; } foreach ( $ allowedOrigins as $ allowedOrigin ) { if ( fnmatch ( $ allowedOrigin , $ origin ) ) { return $ origin ; } } } return 'null' ; }
docstring: Get a single value for the "Access-Control-Allow-Origin" header
  
  According to the spec, it is not valid to set multiple origins separated by commas. Only accepted
  value are wildcard ("*"), an exact domain or a null string.
  
  @link http://www.w3.org/TR/cors/#access-control-allow-origin-response-header
  @param  HttpRequest $request
  @return string
docstring_tokens: Get a single value for the Access - Control - Allow - Origin header