MCPcopy Index your code
hub / github.com/python-websockets/websockets / InvalidHeader

Class InvalidHeader

src/websockets/exceptions.py:260–276  ·  view source on GitHub ↗

Raised when an HTTP header doesn't have a valid format or value.

Source from the content-addressed store, hash-verified

258
259
260class InvalidHeader(InvalidHandshake):
261 """
262 Raised when an HTTP header doesn't have a valid format or value.
263
264 """
265
266 def __init__(self, name: str, value: str | None = None) -> None:
267 self.name = name
268 self.value = value
269
270 def __str__(self) -> str:
271 if self.value is None:
272 return f"missing {self.name} header"
273 elif self.value == "":
274 return f"empty {self.name} header"
275 else:
276 return f"invalid {self.name} header: {self.value}"
277
278
279class InvalidHeaderFormat(InvalidHeader):

Callers 9

process_responseMethod · 0.85
process_subprotocolMethod · 0.85
process_requestMethod · 0.85
process_originMethod · 0.85
handshakeMethod · 0.85
process_originMethod · 0.85
check_requestFunction · 0.85
check_responseFunction · 0.85
test_strMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_strMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…