From the HTTP packet string, populate the scapy object
(self, s)
| 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%") |
nothing calls this directly
no test coverage detected