Example #1
0
 public function doFilter(\blaze\netlet\NetletRequest $request, \blaze\netlet\NetletResponse $response, \blaze\netlet\FilterChain $chain)
 {
     if (!$request->isSecure()) {
         $response->sendRedirect($request->getRequestPath()->replace('http', 'https'));
     } else {
         $chain->doFilter($request, $response);
     }
 }
 private function processNetlet(NetletRequest $request, NetletResponse $response)
 {
     $netlet = $this->getRequestedNetlet($request, $this->context);
     if ($netlet == null) {
         $response->sendError(\blaze\netlet\http\HttpNetletResponse::SC_NOT_FOUND, 'There was no netlet for the request found.');
         return;
     }
     $netlet->service($request, $response);
 }