Process the request before routing it.
510859
def process_request(self, req, resp):  # pylint: disable=unused-argument
        

        if req.path in (self.revoke_endpoint, self.token_endpoint):
            return

        try:
            token = self._get_token(req)
            self.auth_token(token)
        except (AuthRequired, InvalidAuthSyntax) as exc:
            if not self.optional:
                abort(exc)
        except AuthRejected as exc:
            if not self.optional:
                exc.headers = self._get_invalid_token_headers(exc.detail)
                abort(exc)
687788
def process_request(self, request, client_address):
        

        self.finish_request(request, client_address)
        self.shutdown_request(request)
1230902
def _before_request(self):
        
        g._request_id = str(uuid.uuid4())
        g._start_timestamp = time.time()
243231
def prepare(self):
		""""""
		self.scope = 0
		self.mapping = deque([0])
		self._handler = [i() for i in sorted(self.handlers, key=lambda handler: handler.priority)]
625815
public function processRoute()
    {
        foreach ($this->getList() as $pattern => $route) {

            if (isset($route['status']) && empty($route['status'])) {
                continue;
            }

            $arguments = array();

            if (gplcart_path_match($this->path, $pattern, $arguments)) {
                $this->callController($pattern, $arguments);
            }
        }
    }
31053
def prepare(self, context):
		
		
		if __debug__:
			log.debug("Preparing request context.", extra=dict(request=id(context)))
		
		# Bridge in WebOb `Request` and `Response` objects.
		# Extensions shouldn't rely on these, using `environ` where possible instead.
		context.request = Request(context.environ)
		context.response = Response(request=context.request)
		
		# Record the initial path representing the point where a front-end web server bridged to us.
		context.environ['web.base'] = context.request.script_name
		
		# Track the remaining (unprocessed) path elements.
		context.request.remainder = context.request.path_info.split('/')
		if context.request.remainder and not context.request.remainder[0]:
			del context.request.remainder[0]
		
		# Track the "breadcrumb list" of dispatch through distinct controllers.
		context.path = Bread()
847300
function() {
    // Routes
    this.routes = {
      all: {},
      get: {},
      post: {},
      put: {},
      patch: {},
      delete: {}
    };

    // Middleware(s)
    this.pre = []; // run before route middleware
    this.before = []; // run after route middleware but before route handler
    this.after = []; // run after route handler

    // Setup middleware and route handlers
    this.setupPreMiddleware();
    this.setupBeforeMiddleware();
    this.setupRoutes();
    this.setupAfterMiddleware();

    // Response/error handler middleware
    this.after.push(this.successResponse);
    this.after.push(this.errorResponse);
    this.after.push(this.finalResponse);
  }
174612
def process_request
      verb = request.request_method
      path = request.path

      # In RackStep, each request is processed by a controller. The router
      # is responsable to find, based on the given path and http verb,
      # the apropriate controller to handle the request.
      route = router.find_route_for(path, verb)
      # Initialize the correspondent controller.
      controller = route.controller.new
      # Inject the request into the controller.
      controller.request = request
      # Execute the before method of this controller.
      controller.send(:before)
      # Execute the apropriate method/action.
      controller.send(:process_request)
      # Execute the after method of this controller.
      controller.send(:after)
      # Get from the controller what is the response for this request.
      response = controller.response

      return response
    end
178828
private function processURL(): void
    {
        $defaultPath = '';
        $basePath = explode('?', urldecode($_SERVER['REQUEST_URI']));
        $requestURI = explode('/', rtrim($basePath[0], '/'));
        $requestURI[0] = strtoupper($_SERVER['REQUEST_METHOD']);
        $scriptName = explode('/', $_SERVER['SCRIPT_NAME']);
        $sizeofRequestURI = sizeof($requestURI);
        $sizeofScriptName = sizeof($scriptName);
        for ($x = 0; $x < $sizeofRequestURI && $x < $sizeofScriptName; $x++) {
            if (strtolower($requestURI[$x]) == strtolower($scriptName[$x])) {
                $defaultPath .= '/' . $requestURI[$x];
                unset($requestURI[$x]);
            }
        }
        $this->default = $defaultPath . $this->default;
        if (!$this->isFullUrl($this->defaultMobileApp)) {
            $this->defaultMobileApp = $defaultPath . $this->defaultMobileApp;
        }
        $this->parameters = array_values($requestURI);
    }
952967
def _process_request(request)
      _error!(Errors::NotFoundError) unless request.valid?
      _validate_version(request)
      retval = _call_method(request)
      _response(request.post? ? 201 : 200, _prepare_response(retval))
    end
450327
public function runBefore() {
        if($this->_beforeController !== null) {
            foreach($this->_beforeController as $hookProvider) {
                $hookProvider->doBefore();
            }
        }
    }
1136884
public function processRequest()
    {
        // Process Jaxon Request
        $jaxon = jaxon();
        if($jaxon->canProcessRequest())
        {
            $jaxon->register(Jaxon::PROCESSING_EVENT, Jaxon::PROCESSING_EVENT_BEFORE, array($this, 'onEventBefore'));
            $jaxon->register(Jaxon::PROCESSING_EVENT, Jaxon::PROCESSING_EVENT_AFTER, array($this, 'onEventAfter'));
            $jaxon->register(Jaxon::PROCESSING_EVENT, Jaxon::PROCESSING_EVENT_INVALID, array($this, 'onEventInvalid'));
            $jaxon->register(Jaxon::PROCESSING_EVENT, Jaxon::PROCESSING_EVENT_ERROR, array($this, 'onEventError'));
            // Traiter la requete
            $jaxon->processRequest();
        }
    }
135299
protected function before()
    {
        if (    empty($this->client)
            ||  empty($this->clientHash)
            ||  $this->clientHash !== $this->makeSoapClientHash()
        ) {
            $this->initializeClient();
        }
    }
686047
public function prepareResponse()
    {
        try {
            $this->setBaseMiddlewares();
            $this->handleRequest($this->middlewares);
            $this->router->build();
            $this->handleRequest($this->routeMiddlewares);
            $this->response = $this->router->run();
        } catch (Exception $exception) {
            $response = $this->container->call([$this->getExceptionHandler(), 'render'], [$exception]);
            $this->response = $response ?: $this->response;
        }
    }
278788
public function _beforeInit()
    {
        $this->pm = $this->add($this->pagemanager_class, $this->pagemanager_options);
        /** @type Controller_PageManager $this->pm */
        $this->pm->parseRequestedURL();
        parent::_beforeInit();
    }
1071269
protected function BeforeInit()
    {
        if ($this->RemoveTemplate())
        {
            Response::Redirect(Request::Uri());
            return true;
        }
        parent::BeforeInit();
    }
1103589
def exec_before_request_actions(actions, **kwargs):
    
    groups = ("before", "before_" + flask.request.method.lower())
    return execute_actions(actions, limit_groups=groups, **kwargs)