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

Method do_dissect

scapy/layers/http.py:535–549  ·  view source on GitHub ↗

From the HTTP packet string, populate the scapy object

(self, s)

Source from the content-addressed store, hash-verified

533 )
534
535 def do_dissect(self, s):
536 """From the HTTP packet string, populate the scapy object"""
537 first_line, body = _dissect_headers(self, s)
538 try:
539 Method, Path, HTTPVersion = re.split(rb"\s+", first_line, maxsplit=2)
540 self.setfieldval("Method", Method)
541 self.setfieldval("Path", Path)
542 self.setfieldval("Http_Version", HTTPVersion)
543 except ValueError:
544 pass
545 if body:
546 self.raw_packet_cache = s[: -len(body)]
547 else:
548 self.raw_packet_cache = s
549 return body
550
551 def mysummary(self):
552 return self.sprintf("%HTTPRequest.Method% '%HTTPRequest.Path%' ")

Callers

nothing calls this directly

Calls 2

_dissect_headersFunction · 0.85
setfieldvalMethod · 0.45

Tested by

no test coverage detected