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

Method do_dissect

scapy/layers/http.py:581–595  ·  view source on GitHub ↗

From the HTTP packet string, populate the scapy object

(self, s)

Source from the content-addressed store, hash-verified

579 return HTTPRequest in other
580
581 def do_dissect(self, s):
582 """From the HTTP packet string, populate the scapy object"""
583 first_line, body = _dissect_headers(self, s)
584 try:
585 HTTPVersion, Status, Reason = re.split(rb"\s+", first_line, maxsplit=2)
586 self.setfieldval("Http_Version", HTTPVersion)
587 self.setfieldval("Status_Code", Status)
588 self.setfieldval("Reason_Phrase", Reason)
589 except ValueError:
590 pass
591 if body:
592 self.raw_packet_cache = s[: -len(body)]
593 else:
594 self.raw_packet_cache = s
595 return body
596
597 def mysummary(self):
598 return self.sprintf("%HTTPResponse.Status_Code% %HTTPResponse.Reason_Phrase%")

Callers

nothing calls this directly

Calls 2

_dissect_headersFunction · 0.85
setfieldvalMethod · 0.45

Tested by

no test coverage detected