Allow TemplateResponse to be compressed

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2020-05-15 08:38:39 +02:00
parent d132f81d28
commit 4e49e1da16
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 4 additions and 0 deletions

View File

@ -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;