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

Function build_extension

src/websockets/headers.py:411–420  ·  view source on GitHub ↗

Build a ``Sec-WebSocket-Extensions`` header. This is the reverse of :func:`parse_extension`.

(extensions: Sequence[ExtensionHeader])

Source from the content-addressed store, hash-verified

409
410
411def build_extension(extensions: Sequence[ExtensionHeader]) -> str:
412 """
413 Build a ``Sec-WebSocket-Extensions`` header.
414
415 This is the reverse of :func:`parse_extension`.
416
417 """
418 return ", ".join(
419 build_extension_item(name, parameters) for name, parameters in extensions
420 )
421
422
423build_extension_list = build_extension # alias for backwards compatibility

Callers 5

connectMethod · 0.85
process_extensionsMethod · 0.85
handshakeMethod · 0.85
process_extensionsMethod · 0.85
test_parse_extensionMethod · 0.85

Calls 1

build_extension_itemFunction · 0.85

Tested by 1

test_parse_extensionMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…