MCPcopy Create free account
hub / github.com/EasyIME/PIME / get

Method get

python/python3/tornado/test/httpclient_test.py:142–151  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

140
141class InvalidGzipHandler(RequestHandler):
142 def get(self) -> None:
143 # set Content-Encoding manually to avoid automatic gzip encoding
144 self.set_header("Content-Type", "text/plain")
145 self.set_header("Content-Encoding", "gzip")
146 # Triggering the potential bug seems to depend on input length.
147 # This length is taken from the bad-response example reported in
148 # https://github.com/tornadoweb/tornado/pull/2875 (uncompressed).
149 text = "".join("Hello World {}\n".format(i) for i in range(9000))[:149051]
150 body = gzip.compress(text.encode(), compresslevel=6) + b"\00"
151 self.write(body)
152
153
154class HeaderEncodingHandler(RequestHandler):

Callers

nothing calls this directly

Calls 5

set_headerMethod · 0.80
joinMethod · 0.80
formatMethod · 0.45
compressMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected