Executed before sending the response
763135
public function prepareForTransport()
  {
    foreach($this as $k => $v)
    {
      if($v instanceof FortifiApiResponse)
      {
        $v->prepareForTransport();
      }
      else if(is_array($v))
      {
        foreach($v as $vi => $vv)
        {
          if($vv instanceof FortifiApiResponse)
          {
            $vv->prepareForTransport();
          }
        }
      }
    }
  }
822455
protected function beforeAjax()
    {
        if ($this->initialized) {
            return;
        }

        $this->controller->pageAction();
        $this->validateField();
        $this->prepareVars();
        $this->initialized = true;
    }
796733
private void filterBefore(Route route) {
        try {

            for(HttpSupportFilter filter: Configuration.getFilters()){
                if(Configuration.getFilterMetadata(filter).matches(route)){
                    LOGGER.debug("Executing filter: " + filter.getClass().getName() + "#before");
                    filter.before();
                }else{
                    LOGGER.debug("Filter: " + filter.getClass().getName() + "#before  does not match route: " + route );
                }
                if (RequestContext.getControllerResponse() != null){
                    LOGGER.debug("Filter: " + filter.getClass().getName() + "#before  responded to client. Breaking filter chain for route:  " + route );
                    return;//a filter responded, no need to run other filters!
                }
            }
        }catch(RuntimeException e){
            throw e;
        }catch(Exception e){
            throw new FilterException(e);
        }
    }
363063
public void executeBeforeMethods(final Object obj) {
        // Invoke element only if not parameterized
        if (this.element.getDataProvider() == null) {
            // invoking once the beforeFirstRun-method
            if (!beforeFirstRun) {
                beforeFirstRun = true;

                Method[] beforeFirst = null;
                try {
                    beforeFirst = element.findBeforeFirstRun();
                    if (beforeFirst.length != 0) {
                        checkAndExecuteBeforeAfters(obj, BeforeFirstRun.class, beforeFirst);
                    }
                } catch (final PerfidixMethodCheckException e) {
                    BENCHRES.addException(e);
                }
            }

            // invoking the beforeEachRun-method
            Method[] beforeEach = null;
            try {
                beforeEach = element.findBeforeEachRun();
                if (beforeEach.length != 0) {
                    checkAndExecuteBeforeAfters(obj, BeforeEachRun.class, beforeEach);
                }
            } catch (final PerfidixMethodCheckException e) {
                BENCHRES.addException(e);
            }
        }
    }
2099
@Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        preProcessRequest(request);

        DefaultServerDolphin serverDolphin = resolveServerDolphin(request);

        String input = readInput(request);
        if (LOG.isLoggable(Level.FINEST)) {
            LOG.finest("received json: " + input);
        }

        List<Command> commands = decodeInput(serverDolphin.getServerConnector().getCodec(), input);

        List<Command> results = handleCommands(serverDolphin.getServerConnector(), commands);

        String output = encodeOutput(serverDolphin.getServerConnector().getCodec(), results);

        writeHeaders(request, response, results);

        if (LOG.isLoggable(Level.FINEST)) {
            LOG.finest("sending json response: " + output);
        }
        writeOutput(response, output);

        postProcessResponse(response);
    }
1277323
public function execute()
    {
        $this->response = curl_exec($this->curlHandle);

        $this->checkForErrors();

        list($this->responseHeaders, $this->responseBody) = explode("\r\n\r\n", $this->response, 2);
    }
1163806
public static void beforeRequest (@Nonnull final HttpUriRequest aRequest, @Nullable final HttpContext aHttpContext)
  {
    if (isEnabled ())
      if (LOGGER.isInfoEnabled ())
        LOGGER.info ("Before HTTP call: " +
                        aRequest.getMethod () +
                        " " +
                        aRequest.getURI () +
                        (aHttpContext != null ? " (with special HTTP context)" : ""));
  }
830191
async function beforeEachHook(done) {
    browser.__autoStart = browser.__prom = browser.__rejectSerial = browser.__resolveSerial = null;
    done && done();
}
305814
function beforeRead (controller, args, forms, queryArgs) {
    // load records
    return loadRecord(controller, args, queryArgs).then(res => {
        // if no forms then return response
        if (!defined(forms)) {
            return res
        }
        // build forms for record
        return buildForms(args, controller, forms, res[controller.model.name])
        // merge forms to res which will go to args
        .then(forms => {
            res.forms = forms
            // return response with instance and forms
            return res
        })
    })
}
1308218
async def _on_response_prepare(self,
                                   request: web.Request,
                                   response: web.StreamResponse):
        
        if (not self._router_adapter.is_cors_enabled_on_request(request) or
                self._router_adapter.is_preflight_request(request)):
            # Either not CORS enabled route, or preflight request which is
            # handled in its own handler.
            return

        # Processing response of non-preflight CORS-enabled request.

        config = self._router_adapter.get_non_preflight_request_config(request)

        # Handle according to part 6.1 of the CORS specification.

        origin = request.headers.get(hdrs.ORIGIN)
        if origin is None:
            # Terminate CORS according to CORS 6.1.1.
            return

        options = config.get(origin, config.get("*"))
        if options is None:
            # Terminate CORS according to CORS 6.1.2.
            return

        assert hdrs.ACCESS_CONTROL_ALLOW_ORIGIN not in response.headers
        assert hdrs.ACCESS_CONTROL_ALLOW_CREDENTIALS not in response.headers
        assert hdrs.ACCESS_CONTROL_EXPOSE_HEADERS not in response.headers

        # Process according to CORS 6.1.4.
        # Set exposed headers (server headers exposed to client) before
        # setting any other headers.
        if options.expose_headers == "*":
            # Expose all headers that are set in response.
            exposed_headers = \
                frozenset(response.headers.keys()) - _SIMPLE_RESPONSE_HEADERS
            response.headers[hdrs.ACCESS_CONTROL_EXPOSE_HEADERS] = \
                ",".join(exposed_headers)

        elif options.expose_headers:
            # Expose predefined list of headers.
            response.headers[hdrs.ACCESS_CONTROL_EXPOSE_HEADERS] = \
                ",".join(options.expose_headers)

        # Process according to CORS 6.1.3.
        # Set allowed origin.
        response.headers[hdrs.ACCESS_CONTROL_ALLOW_ORIGIN] = origin
        if options.allow_credentials:
            # Set allowed credentials.
            response.headers[hdrs.ACCESS_CONTROL_ALLOW_CREDENTIALS] = _TRUE
80663
def send_response(self, response):
        
        response_bytes = response.encode(config.CODEC)
        log.debug("About to send reponse: %r", response_bytes)
        self.socket.send(response_bytes)
561768
async def pre_handle(self, request: Request, responder: 'Responder'):
        

        responder.send([lyr.Typing()])
        await responder.flush(request)
        responder.clear()

        await self.next(request, responder)
1075275
public function onBefore(BeforeEvent $event)
    {
        $request = $event->getRequest();

        if (!$this->canCacheRequest($request)) {
            $this->cacheMiss($request);
            return;
        }

        if (!($response = $this->storage->fetch($request))) {
            $this->cacheMiss($request);
            return;
        }

        $response->setHeader('Age', Utils::getResponseAge($response));
        $valid = $this->validate($request, $response);

        // Validate that the response satisfies the request
        if ($valid) {
            $request->getConfig()->set('cache_lookup', 'HIT');
            $request->getConfig()->set('cache_hit', true);
            $event->intercept($response);
        } else {
            $this->cacheMiss($request);
        }
    }
81398
public function renderResponse() {

		if(isset($this->methodName)) {
			$methodName = $this->methodName;
			$this->$methodName()->send();
		}
		else {
			$this->execute()->send();
		}

	}
1093354
public function execute()
    {
        /** @var EventHandler $eventHandler */
        $eventHandler = $this->make(EventHandler::class);
        $eventHandler->trigger(BeforeExecute::class);

        /** @var Request $request */
        $request = $this->make(Request::class);
        $request->compute();
    }
1099528
public function execute()
    {
        // Execute the before execution event
        $this->runtimeManager->executeEvent('\\Zepi\\Turbo\\Event\\BeforeExecution');
        
        // Get the event name for the request and execute the event
        $eventName = $this->routeManager->getEventNameForRoute($this->request);
        $eventName = $this->runtimeManager->executeFilter('\\Zepi\\Turbo\\Filter\\VerifyEventName', $eventName);

        if ($eventName !== false && $eventName != '') {
            $this->runtimeManager->executeEvent($eventName);
        } else {
            $this->runtimeManager->executeEvent('\\Zepi\\Turbo\\Event\\RouteNotFound');
        }
        
        // Execute the after execution event
        $this->runtimeManager->executeEvent('\\Zepi\\Turbo\\Event\\AfterExecution');

        // Finalize the output
        $this->runtimeManager->executeEvent('\\Zepi\\Turbo\\Event\\FinalizeOutput');
        
        // Execute the before output event
        $this->runtimeManager->executeEvent('\\Zepi\\Turbo\\Event\\BeforeOutput');
        
        // Print the output
        echo $this->response->getOutput();
        
        // Execute the after output event
        $this->runtimeManager->executeEvent('\\Zepi\\Turbo\\Event\\AfterOutput');
    }
1305111
public boolean preHandle(HttpServletRequest request,
                             HttpServletResponse response, Object handler) throws Exception {

        String queryString = request.getQueryString() == null ? "" : request.getQueryString();

        if (ConfigurationService.getInstance().isValid()
                || request.getServletPath().startsWith("/configuration")
                || request.getServletPath().startsWith("/resources")
                || queryString.contains("requestFromConfiguration=true")) {
            return true;
        } else {
            response.sendRedirect("configuration");
            return false;
        }
    }