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

Method authority

mitmproxy/http.py:680–695  ·  view source on GitHub ↗

HTTP request authority. For HTTP/1, this is the authority portion of the request target (in either absolute-form or authority-form). For origin-form and asterisk-form requests, this property is set to an empty string. For HTTP/2, this is the :authority pseu

(self)

Source from the content-addressed store, hash-verified

678
679 @property
680 def authority(self) -> str:
681 """
682 HTTP request authority.
683
684 For HTTP/1, this is the authority portion of the request target
685 (in either absolute-form or authority-form).
686 For origin-form and asterisk-form requests, this property is set to an empty string.
687
688 For HTTP/2, this is the :authority pseudo header.
689
690 *See also:* `Request.host`, `Request.host_header`, `Request.pretty_host`
691 """
692 try:
693 return self.data.authority.decode("idna")
694 except UnicodeError:
695 return self.data.authority.decode("utf8", "surrogateescape")
696
697 @authority.setter
698 def authority(self, val: str | bytes) -> None:

Callers

nothing calls this directly

Calls 2

decodeMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected