MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / constrain_encoding

Method constrain_encoding

mitmproxy/http.py:920–930  ·  view source on GitHub ↗

Limits the permissible Accept-Encoding values, based on what we can decode appropriately.

(self)

Source from the content-addressed store, hash-verified

918 self.headers["accept-encoding"] = "identity"
919
920 def constrain_encoding(self) -> None:
921 """
922 Limits the permissible Accept-Encoding values, based on what we can decode appropriately.
923 """
924 accept_encoding = self.headers.get("accept-encoding")
925 if accept_encoding:
926 self.headers["accept-encoding"] = ", ".join(
927 e
928 for e in {"gzip", "identity", "deflate", "br", "zstd"}
929 if e in accept_encoding
930 )
931
932 def _get_urlencoded_form(self):
933 is_valid_content_type = (

Callers 2

Calls 2

getMethod · 0.45
joinMethod · 0.45

Tested by 2