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

Function parse_OWS

src/websockets/headers.py:88–100  ·  view source on GitHub ↗

Parse optional whitespace from ``header`` at the given position. Return the new position. The whitespace itself isn't returned because it isn't significant.

(header: str, pos: int)

Source from the content-addressed store, hash-verified

86
87
88def parse_OWS(header: str, pos: int) -> int:
89 """
90 Parse optional whitespace from ``header`` at the given position.
91
92 Return the new position.
93
94 The whitespace itself isn't returned because it isn't significant.
95
96 """
97 # There's always a match, possibly empty, whose content doesn't matter.
98 match = _OWS_re.match(header, pos)
99 assert match is not None
100 return match.end()
101
102
103_token_re = re.compile(r"[-!#$%&\'*+.^_`|~0-9a-zA-Z]+")

Callers 3

parse_listFunction · 0.85
parse_extension_itemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…