MCPcopy
hub / github.com/sphinx-doc/sphinx / do_GET

Method do_GET

tests/test_builders/test_build_linkcheck.py:65–82  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

63 self.end_headers()
64
65 def do_GET(self) -> None:
66 if self.path[1:].rstrip() == '':
67 content = b'ok\n\n'
68 elif self.path[1:].rstrip() == 'anchor.html':
69 doc = '<!DOCTYPE html><html><body><a id="found"></a></body></html>'
70 content = doc.encode('utf-8')
71 else:
72 content = b''
73
74 if content:
75 self.send_response(200, 'OK')
76 self.send_header('Content-Length', str(len(content)))
77 self.end_headers()
78 self.wfile.write(content)
79 else:
80 self.send_response(404, 'Not Found')
81 self.send_header('Content-Length', '0')
82 self.end_headers()
83
84
85class ConnectionMeasurement:

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected