src/Vectorface/SnappyRouter/Plugin/AccessControl/CrossOriginRequestPlugin.php
private function addHeadersForOptionsRequests()
    {
        // header for preflight cache expiry
        $maxAge = self::MAX_AGE;
        if (isset($this->options[self::HEADER_MAX_AGE])) {
            $maxAge = intval($this->options[self::HEADER_MAX_AGE]);
        }
        @header(self::HEADER_MAX_AGE.': '.$maxAge);

        // header for allowed request headers in cross origin requests
        $allowedHeaders = self::$allowedHeaders;
        if (isset($this->options[self::HEADER_ALLOW_HEADERS])) {
            $allowedHeaders = (array)$this->options[self::HEADER_ALLOW_HEADERS];
        }
        @header(self::HEADER_ALLOW_HEADERS.':'.implode(',', $allowedHeaders));

        // header for allowed HTTP methods in cross orgin requests
        $allowedMethods = self::$allowedMethods;
        if (isset($this->options[self::HEADER_ALLOW_METHODS])) {
            $allowedMethods = (array)$this->options[self::HEADER_ALLOW_METHODS];
        }
        @header(self::HEADER_ALLOW_METHODS.':'.implode(',', $allowedMethods));
    }
private function addHeadersForOptionsRequests()
    {
        // header for preflight cache expiry
        $maxAge = self::MAX_AGE;
        if (isset($this->options[self::HEADER_MAX_AGE])) {
            $maxAge = intval($this->options[self::HEADER_MAX_AGE]);
        }
        @header(self::HEADER_MAX_AGE.': '.$maxAge);

        // header for allowed request headers in cross origin requests
        $allowedHeaders = self::$allowedHeaders;
        if (isset($this->options[self::HEADER_ALLOW_HEADERS])) {
            $allowedHeaders = (array)$this->options[self::HEADER_ALLOW_HEADERS];
        }
        @header(self::HEADER_ALLOW_HEADERS.':'.implode(',', $allowedHeaders));

        // header for allowed HTTP methods in cross orgin requests
        $allowedMethods = self::$allowedMethods;
        if (isset($this->options[self::HEADER_ALLOW_METHODS])) {
            $allowedMethods = (array)$this->options[self::HEADER_ALLOW_METHODS];
        }
        @header(self::HEADER_ALLOW_METHODS.':'.implode(',', $allowedMethods));
    }
private function addHeadersForOptionsRequests ( ) { // header for preflight cache expiry $ maxAge = self :: MAX_AGE ; if ( isset ( $ this -> options [ self :: HEADER_MAX_AGE ] ) ) { $ maxAge = intval ( $ this -> options [ self :: HEADER_MAX_AGE ] ) ; } @ header ( self :: HEADER_MAX_AGE . ': ' . $ maxAge ) ; // header for allowed request headers in cross origin requests $ allowedHeaders = self :: $ allowedHeaders ; if ( isset ( $ this -> options [ self :: HEADER_ALLOW_HEADERS ] ) ) { $ allowedHeaders = ( array ) $ this -> options [ self :: HEADER_ALLOW_HEADERS ] ; } @ header ( self :: HEADER_ALLOW_HEADERS . ':' . implode ( ',' , $ allowedHeaders ) ) ; // header for allowed HTTP methods in cross orgin requests $ allowedMethods = self :: $ allowedMethods ; if ( isset ( $ this -> options [ self :: HEADER_ALLOW_METHODS ] ) ) { $ allowedMethods = ( array ) $ this -> options [ self :: HEADER_ALLOW_METHODS ] ; } @ header ( self :: HEADER_ALLOW_METHODS . ':' . implode ( ',' , $ allowedMethods ) ) ; }
Adds additional headers for the OPTIONS http verb.
Adds additional headers for the OPTIONS http verb .