MCPcopy
hub / github.com/0x727/ShuiZe_0x727 / parse_send_headers

Method parse_send_headers

Plugins/Vul/CMS/Tomcat_AJP_LFI.py:201–215  ·  view source on GitHub ↗
(self, stream)

Source from the content-addressed store, hash-verified

199 raise NotImplementedError
200
201 def parse_send_headers(self, stream):
202 self.http_status_code, = unpack(stream, ">H")
203 self.http_status_msg = unpack_string(stream)
204 self.num_headers, = unpack(stream, ">H")
205 self.response_headers = {}
206 for i in range(self.num_headers):
207 code, = unpack(stream, ">H")
208 if code <= 0xA000: # custom header
209 h_name, = unpack(stream, "%ds" % code)
210 stream.read(1) # \0
211 h_value = unpack_string(stream)
212 else:
213 h_name = AjpResponse.COMMON_SEND_HEADERS[code-0xA001]
214 h_value = unpack_string(stream)
215 self.response_headers[h_name] = h_value
216
217 def parse_send_body_chunk(self, stream):
218 self.data_length, = unpack(stream, ">H")

Callers 1

parseMethod · 0.95

Calls 2

unpackFunction · 0.85
unpack_stringFunction · 0.85

Tested by

no test coverage detected