From 4e49e1da1624337a92022a25c8315d3758058224 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Fri, 15 May 2020 08:38:39 +0200 Subject: [PATCH] Allow TemplateResponse to be compressed Signed-off-by: Morris Jobke --- lib/private/AppFramework/Middleware/CompressionMiddleware.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/private/AppFramework/Middleware/CompressionMiddleware.php b/lib/private/AppFramework/Middleware/CompressionMiddleware.php index e0eb0e0883..6956be7669 100644 --- a/lib/private/AppFramework/Middleware/CompressionMiddleware.php +++ b/lib/private/AppFramework/Middleware/CompressionMiddleware.php @@ -29,6 +29,7 @@ use OC\AppFramework\OCS\BaseResponse; use OCP\AppFramework\Http; use OCP\AppFramework\Http\JSONResponse; use OCP\AppFramework\Http\Response; +use OCP\AppFramework\Http\TemplateResponse; use OCP\AppFramework\Middleware; use OCP\IRequest; @@ -67,6 +68,9 @@ class CompressionMiddleware extends Middleware { if ($response instanceof JSONResponse) { $allowGzip = true; } + if ($response instanceof TemplateResponse) { + $allowGzip = true; + } if ($allowGzip) { $this->useGZip = true;