F
Filament9mo ago
Wiin

Problem with gzip middleware

Hello, for some reason when setting up my gzip middleware I'm getting a blank page on filament panels. The middleware is working fine for non-filament pages. I think the problem is related to some script not loading correctly after decompressing, but I'm not completely sure. Does anyone have any idea of what could be happening? Thanks. //Middleware class GzipEncodeResponse { /** * Handle an incoming request. * * @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next */ public function handle(Request $request, Closure $next): Response { $response = $next($request); if (in_array('gzip', $request->getEncodings()) && function_exists('gzencode')) { $response->setContent(gzencode($response->getContent(), 9)); $response->headers->add([ 'Content-Encoding' => 'gzip', 'X-Vapor-Base64-Encode' => 'True', ]); } return $response; }
3 Replies
Kristijan
Kristijan7mo ago
I have the same problem. Still not resolved.
ralphjsmit
ralphjsmit3w ago
I can confirm the posted solution works ^

Did you find this page helpful?