Handles an HTTP OPTIONS requests.
Returns available methods for the current route.

@return void.
555118
public function handleOptionsRequest()
    {
        // Generate the "Allow" header
        $allow = '';
        foreach ($this->router->getMethodsByRoute($this->uri) as $method) {
            $allow .= strtoupper($method) . ',';
        }
        $allow = substr($allow, 0, strlen($allow) - 1);
        header('Allow: ' . $allow);
        $this->setResponse('');
    }
277981
public void handleOptions(HttpServletRequest request, HttpServletResponse response) throws IOException
    {
        // Handle OPTIONS request for entire server
        // 9.2
        response.setIntHeader(HttpFields.__ContentLength, 0);
        response.setHeader(HttpFields.__Allow, _AllowString);
        response.flushBuffer();
    }
719905
protected function setOptions() {
        $this->resource->setOption(CURLOPT_URL, $this->createUrl());
        $this->resource->setOption(CURLOPT_CUSTOMREQUEST, $this->request->getMethod());
        $this->resource->setOption(CURLOPT_RETURNTRANSFER, true);
        $this->resource->setOption(CURLOPT_HEADER, true);

        $this->resource->setOption(
            CURLOPT_FOLLOWLOCATION,
            $this->options->get(HttpClientOptions::FOLLOW_REDIRECT, false)
        );

        if ($this->options->get(HttpClientOptions::VERIFY_SSL, true)) {
            $this->resource->setOption(CURLOPT_SSL_VERIFYPEER, true);
            $this->resource->setOption(CURLOPT_SSL_VERIFYHOST, 2);
        } else {
            $this->resource->setOption(CURLOPT_SSL_VERIFYPEER, false);
            $this->resource->setOption(CURLOPT_SSL_VERIFYHOST, false);
        }

        foreach ($this->options->toArray() as $option => $value) {
            if (str_starts_with($option, 'CURLOPT_') && defined($option)) {
                $this->resource->setOption(constant($option), $value);
            }
        }
    }
1034375
def options(path, options = {}, &block)
      perform_request Net::HTTP::Options, path, options, &block
    end
1250523
public function routeHttp()
    {
        if ($this->config->isInitialized() || $this->url->isInstall()) {
            $this->route->process();
        } else {
            $this->url->redirect('install');
        }
    }
165398
public static function dispatch()
    {
        $uri = strtok($_SERVER["REQUEST_URI"],'?');
        $qs = parse_url($_SERVER["REQUEST_URI"], PHP_URL_QUERY);
        $method = $_SERVER['REQUEST_METHOD'];
        
        
        foreach (self::$routes as $name=>$route) {


            $route  = self::parsePattern($route);

            $matched = array();
            if ($route=='' || preg_match('#' . $route . '#', $uri, $matched) && (self::$methods[$name] == 'ANY' || self::$methods[$name] == $method)) {
                
                array_shift($matched);

                if (self::$qs[$name]!='' && preg_match('#' . self::$qs[$name] . '#', $qs, $qsmatched)) {

                    array_shift($qsmatched);

                    $matched = array_merge($matched, $qsmatched);
                    self::$catched[] = $name;
                    BurpEvent::listen($name, self::$callbacks[$name]);
                    BurpEvent::queue($name, $matched);

                } elseif (self::$qs[$name] == '') {
                    self::$catched[] = $name;
                    BurpEvent::listen($name, self::$callbacks[$name]);
                    BurpEvent::queue($name, $matched);
                }
            }

        }

        //call missing if needed
        if (!is_null(self::$missing_callback) ) {
            $diff = array_diff(self::$tocatch, self::$catched);
            if (count($diff) >= count(self::$tocatch)) {
                call_user_func(self::$missing_callback);
                BurpEvent::listen('missing', self::$callbacks[$name]);
                BurpEvent::fire('missing');

            }

        }

        BurpEvent::flushAll();
    }
1029779
public function connect()
    {
      if ($this->route) {
        if ($_SERVER['REQUEST_METHOD'] === $this->routeMethod[0] || $this->routeMethod[0] == 'ANY') {

          // If handler is function
          if (is_callable($this->handler)) {
            call_user_func($this->handler, (object) $this->params[0]);
          }
          // // If handler is controller and method name
          else {
            $controller_data =  explode('@', $this->handler);
            $controller = $this->namespace . '\\' . ucwords($controller_data[0]) . 'Controller';
            $action = 'action' . ucwords($controller_data[1]);

            // If class exists
            if (class_exists($controller)) {
              $controllerInstance = new $controller;
            } else {
              exit('Class Not Found');
            }

            // If method exists
            if (method_exists($controllerInstance, $action))	{
              call_user_func_array([$controllerInstance, $action], [(object) $this->params[0]]);
            }	else {
              exit('Controller Method Not Found');
            }
          }
        } else {
          exit('HTTP method not allowed');
        }
      }
      // If route not found
      elseif($this->check($this->routerCollection->getAllRoutes(), parse_url($_SERVER['REQUEST_URI'])['path'])) {
        exit('HTTP method not allowed');
      } else {
        exit('Route Not Found');
      }
    }
180085
def options(self, request, *args, **kwargs):
        
        allow = []
        for method in self.http_method_names:
            if hasattr(self, method):
                allow.append(method.upper())
        r = self.render_to_response(None)
        r['Allow'] = ','.join(allow)
        return r
934929
public static function handleCurrentRequest() {
		try {
			CLIRoute::initialize();
			static::$mainRequest = static::generateFromEnvironment();
			$response = static::$mainRequest->process();
		} catch( \Exception $e ) {
			$response = CLIResponse::generateFromException($e);
		}
		$response->process();
		exit($response->getCode());
	}
1102076
public function handle()
    {
        // get information about the REST-request
        $this->get();

        if ($this->requestMethod === 'GET' && $this->typo3Cache->hasCacheEntry($this->url, $_GET)) {
            return $this->handleRequestByTypo3Cache();
        }

        // if no cache exist: restler should handle the request
        return parent::handle();
    }
1290812
public function processOptionRoutes()
    {
        $this->alert('ROUTES PROCESS');

        // Verify option ROUTES
        if (in_array(strtoupper(trim($this->option('routes'))), ['N','NO','FALSE'])) {
            $this->routes = false;
        }

    }
889780
protected function handleDefaultOptions()
    {
        if ($this->options->getOpt('no-colors')) {
            $this->colors->disable();
        }
        if ($this->options->getOpt('help')) {
            echo $this->options->help();
            exit(0);
        }
    }
1316419
public function handleRequests(): void
    {
        $tail_call = false;
        do {
            $this->arg = $this->simpleArg;
            $this->stack = [$this->arg];
            $this->idx = 0;
            $this->parser->parse();
            if (count($this->stack) > 1) {
                $arg = array_pop($this->stack);
                if ($arg instanceof ApplyArg) {
                    $this->apply($arg);
                } else {
                    $msg = 'Error: $arg should be of type ApplyArg, error in client';
                    $this->logger->critical($msg);
                    throw new Exception\RuntimeException($msg);
                }
                $tail_call = true;
            }
            $this->stack = null;
        } while ($tail_call);
    }
131694
public function getOptions(Request $request)
    {
        $return = array();
        if ($request->attributes->has('is_rest_request') && $request->attributes->get('is_rest_request') === true) {
            $return['allow_methods'] = $this->getAllowedMethods($request->getPathInfo());
        }

        return $return;
    }
314926
protected function _setOptions()
    {
        if (!is_null($this->getHeader())) {
            $this->_setOpt(CURLOPT_HTTPHEADER, $this->getHeader());
        }
        $this->_setOpt(CURLOPT_URL, $this->getUrl());

        if ($this->getMethod() == "POST") {
            $this->_setOpt(CURLOPT_POST, 1);
            $this->_setOpt(CURLOPT_POSTFIELDS, $this->_formParamsForPost($this->getParameters()));
        }

        $aOptions = $this->getOptions();
        if (count($aOptions)) {
            foreach ($aOptions as $sName => $mValue) {
                $this->_setOpt(constant($sName), $mValue);
            }
        }
    }
622414
protected function initOptions()
    {
        // Set method
        if ($this->method == 'POST') {
            $this->addCurlOption(CURLOPT_POST, true);
        } elseif (in_array($this->method, ['DELETE', 'HEAD', 'PATCH', 'PUT'])) {
            if ($this->method == 'HEAD') {
                $this->addCurlOption(CURLOPT_NOBODY, true);
            }

            $this->addCurlOption(CURLOPT_CUSTOMREQUEST, $this->method);
        }

        // Set allowed protocols
        if (defined('CURLOPT_PROTOCOLS')) {
            $this->addCurlOption(CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
        }

        // Handle options from payload
        if (! empty($this->payload['options']) && is_array($this->payload['options'])) {
            // Add authentication
            $this->handleAuthentication();

            // Add user options
            $this->handleUserOptions();
        }

        $this->mergeCurlOptions();
    }
997363
function options() {
        $this->header_unset();
        $this->create_basic_request('OPTIONS');
        $this->send_request();
        $this->get_respond();
        $response = $this->process_respond();
        // validate the response ...
        // check http-version
        if ($response['status']['http-version'] == 'HTTP/1.1' ||
            $response['status']['http-version'] == 'HTTP/1.0') {
                return $response;
            }
        $this->_error_log('Response was not even http');
        return false;

    }