diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-08-11 15:47:13 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-08-11 15:47:13 +0200 |
commit | a38d19576c387e505cc468b20ca5b8bcf2fa4759 (patch) | |
tree | a578f4056dfea683d3bb2714ae1620eac576da0e /src/hydrilla/proxy/policies/rule.py | |
parent | ad97639bbf982b5b3b2757e75c3f91556e3a8eac (diff) | |
download | haketilo-hydrilla-a38d19576c387e505cc468b20ca5b8bcf2fa4759.tar.gz haketilo-hydrilla-a38d19576c387e505cc468b20ca5b8bcf2fa4759.zip |
move classes/protocols for representing HTTP requests and responses data into a separate file
Diffstat (limited to 'src/hydrilla/proxy/policies/rule.py')
-rw-r--r-- | src/hydrilla/proxy/policies/rule.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/hydrilla/proxy/policies/rule.py b/src/hydrilla/proxy/policies/rule.py index eb70147..bcb110e 100644 --- a/src/hydrilla/proxy/policies/rule.py +++ b/src/hydrilla/proxy/policies/rule.py @@ -37,6 +37,7 @@ import typing as t from ...url_patterns import ParsedPattern from .. import csp from .. import state +from ..import http_messages from . import base @@ -50,7 +51,7 @@ class BlockPolicy(base.Policy): priority: t.ClassVar[base.PolicyPriority] = base.PolicyPriority._TWO - def _modify_headers(self, response_info: base.ResponseInfo) \ + def _modify_headers(self, response_info: http_messages.ResponseInfo) \ -> t.Iterable[tuple[bytes, bytes]]: """....""" csp_policies = csp.extract(response_info.headers) @@ -80,8 +81,8 @@ class BlockPolicy(base.Policy): yield b'Content-Security-Policy', extra_csp.encode() - def consume_response(self, response_info: base.ResponseInfo) \ - -> base.ProducedResponse: + def consume_response(self, response_info: http_messages.ResponseInfo) \ + -> http_messages.ProducedResponse: """....""" new_response = response_info.make_produced_response() |