From 0dbabb9cd841008b6e6669342276909dd637b1d9 Mon Sep 17 00:00:00 2001 From: Abhinav Singh Date: Tue, 28 Dec 2021 10:06:05 +0530 Subject: [PATCH 1/2] Fix `HttpWebServerPacFilePlugin` broken routes logic --- proxy/http/server/pac_plugin.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proxy/http/server/pac_plugin.py b/proxy/http/server/pac_plugin.py index 2e6e233872..f76c06c04a 100644 --- a/proxy/http/server/pac_plugin.py +++ b/proxy/http/server/pac_plugin.py @@ -52,8 +52,10 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: def routes(self) -> List[Tuple[int, str]]: if self.flags.pac_file_url_path: return [ - (httpProtocolTypes.HTTP, text_(self.flags.pac_file_url_path)), - (httpProtocolTypes.HTTPS, text_(self.flags.pac_file_url_path)), + (httpProtocolTypes.HTTP, r'{0}$'.format( + text_(self.flags.pac_file_url_path))), + (httpProtocolTypes.HTTPS, r'{0}$'.format( + text_(self.flags.pac_file_url_path))), ] return [] # pragma: no cover From 0e2a77aa6d0abd166cc4942be1857296a693eb48 Mon Sep 17 00:00:00 2001 From: Abhinav Singh Date: Tue, 28 Dec 2021 10:12:43 +0530 Subject: [PATCH 2/2] lint --- proxy/http/server/pac_plugin.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/proxy/http/server/pac_plugin.py b/proxy/http/server/pac_plugin.py index f76c06c04a..befe483a9b 100644 --- a/proxy/http/server/pac_plugin.py +++ b/proxy/http/server/pac_plugin.py @@ -52,10 +52,16 @@ def __init__(self, *args: Any, **kwargs: Any) -> None: def routes(self) -> List[Tuple[int, str]]: if self.flags.pac_file_url_path: return [ - (httpProtocolTypes.HTTP, r'{0}$'.format( - text_(self.flags.pac_file_url_path))), - (httpProtocolTypes.HTTPS, r'{0}$'.format( - text_(self.flags.pac_file_url_path))), + ( + httpProtocolTypes.HTTP, r'{0}$'.format( + text_(self.flags.pac_file_url_path), + ), + ), + ( + httpProtocolTypes.HTTPS, r'{0}$'.format( + text_(self.flags.pac_file_url_path), + ), + ), ] return [] # pragma: no cover