From 3c4079c1adfee8d07a328f987ed26d9c5fc5a6aa Mon Sep 17 00:00:00 2001 From: Abhinav Singh Date: Tue, 28 Dec 2021 11:23:20 +0530 Subject: [PATCH] Dont compress pac file --- proxy/http/responses.py | 2 +- proxy/http/server/pac_plugin.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/proxy/http/responses.py b/proxy/http/responses.py index 9e865cd274..65b548b3bf 100644 --- a/proxy/http/responses.py +++ b/proxy/http/responses.py @@ -90,7 +90,7 @@ def okResponse( **kwargs: Any, ) -> memoryview: do_compress: bool = False - if compress and flags.args and content and len(content) > flags.args.min_compression_limit: + if flags.args and compress and content and len(content) > flags.args.min_compression_limit: do_compress = True if not headers: headers = {} diff --git a/proxy/http/server/pac_plugin.py b/proxy/http/server/pac_plugin.py index befe483a9b..8cc0a4d0f0 100644 --- a/proxy/http/server/pac_plugin.py +++ b/proxy/http/server/pac_plugin.py @@ -80,7 +80,7 @@ def cache_pac_file_response(self) -> None: content=content, headers={ b'Content-Type': b'application/x-ns-proxy-autoconfig', - b'Content-Encoding': b'gzip', }, conn_close=True, + compress=False, )