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

Function parse_upgrade

src/websockets/headers.py:286–299  ·  view source on GitHub ↗

Parse an ``Upgrade`` header. Return a list of HTTP protocols. Args: header: Value of the ``Upgrade`` header. Raises: InvalidHeaderFormat: On invalid inputs.

(header: str)

Source from the content-addressed store, hash-verified

284
285
286def parse_upgrade(header: str) -> list[UpgradeProtocol]:
287 """
288 Parse an ``Upgrade`` header.
289
290 Return a list of HTTP protocols.
291
292 Args:
293 header: Value of the ``Upgrade`` header.
294
295 Raises:
296 InvalidHeaderFormat: On invalid inputs.
297
298 """
299 return parse_list(parse_upgrade_protocol, header, 0, "Upgrade")
300
301
302def parse_extension_item_param(

Callers 6

process_responseMethod · 0.85
process_requestMethod · 0.85
check_requestFunction · 0.85
check_responseFunction · 0.85
test_parse_upgradeMethod · 0.85

Calls 1

parse_listFunction · 0.85

Tested by 2

test_parse_upgradeMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…