MCPcopy
hub / github.com/zhzyker/exphub / parse_send_headers

Method parse_send_headers

tomcat/cve-2020-1938_exp.py:195–209  ·  view source on GitHub ↗
(self, stream)

Source from the content-addressed store, hash-verified

193 raise NotImplementedError
194
195 def parse_send_headers(self, stream):
196 self.http_status_code, = unpack(stream, ">H")
197 self.http_status_msg = unpack_string(stream)
198 self.num_headers, = unpack(stream, ">H")
199 self.response_headers = {}
200 for i in range(self.num_headers):
201 code, = unpack(stream, ">H")
202 if code <= 0xA000: # custom header
203 h_name, = unpack(stream, "%ds" % code)
204 stream.read(1) # \0
205 h_value = unpack_string(stream)
206 else:
207 h_name = AjpResponse.COMMON_SEND_HEADERS[code-0xA001]
208 h_value = unpack_string(stream)
209 self.response_headers[h_name] = h_value
210
211 def parse_send_body_chunk(self, stream):
212 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