MCPcopy
hub / github.com/postmanlabs/httpbin / parse_multi_value_header

Function parse_multi_value_header

httpbin/helpers.py:433–442  ·  view source on GitHub ↗

Break apart an HTTP header string that is potentially a quoted, comma separated list as used in entity headers in RFC2616.

(header_str)

Source from the content-addressed store, hash-verified

431 return first_byte_pos, last_byte_pos
432
433def parse_multi_value_header(header_str):
434 """Break apart an HTTP header string that is potentially a quoted, comma separated list as used in entity headers in RFC2616."""
435 parsed_parts = []
436 if header_str:
437 parts = header_str.split(',')
438 for part in parts:
439 match = re.search('\s*(W/)?\"?([^"]*)\"?\s*', part)
440 if match is not None:
441 parsed_parts.append(match.group(2))
442 return parsed_parts
443
444
445def next_stale_after_value(stale_after):

Callers 2

etagFunction · 0.85

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…