MCPcopy Index your code
hub / github.com/python/cpython / do_GET

Method do_GET

Lib/test/ssl_servers.py:93–109  ·  view source on GitHub ↗

Serve a GET request.

(self, send_body=True)

Source from the content-addressed store, hash-verified

91 server_version = "StatsHTTPS/1.0"
92
93 def do_GET(self, send_body=True):
94 """Serve a GET request."""
95 sock = self.rfile.raw._sock
96 context = sock.context
97 stats = {
98 'session_cache': context.session_stats(),
99 'cipher': sock.cipher(),
100 'compression': sock.compression(),
101 }
102 body = pprint.pformat(stats)
103 body = body.encode('utf-8')
104 self.send_response(200)
105 self.send_header("Content-type", "text/plain; charset=utf-8")
106 self.send_header("Content-Length", str(len(body)))
107 self.end_headers()
108 if send_body:
109 self.wfile.write(body)
110
111 def do_HEAD(self):
112 """Serve a HEAD request."""

Callers 1

do_HEADMethod · 0.95

Calls 9

strFunction · 0.85
pformatMethod · 0.80
send_responseMethod · 0.80
send_headerMethod · 0.80
cipherMethod · 0.45
compressionMethod · 0.45
encodeMethod · 0.45
end_headersMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected