MCPcopy Create free account
hub / github.com/secdev/scapy / _optimize_header_length_and_packetify

Method _optimize_header_length_and_packetify

scapy/contrib/http2.py:2500–2505  ·  view source on GitHub ↗
(s)

Source from the content-addressed store, hash-verified

2498
2499 @staticmethod
2500 def _optimize_header_length_and_packetify(s):
2501 # type: (str) -> HPackHdrString
2502 zs = HPackZString(s)
2503 if len(zs) >= len(s):
2504 return HPackHdrString(data=HPackLiteralString(s))
2505 return HPackHdrString(data=zs)
2506
2507 def _convert_a_header_to_a_h2_header(self, hdr_name, hdr_value, is_sensitive, should_index): # noqa: E501
2508 # type: (str, str, Callable[[str, str], bool], Callable[[str], bool]) -> Tuple[HPackHeaders, int] # noqa: E501

Callers 1

Calls 3

HPackZStringClass · 0.85
HPackHdrStringClass · 0.85
HPackLiteralStringClass · 0.85

Tested by

no test coverage detected