| 139 | sys.stderr.write("[javascript-browser-harness] " + (fmt % args) + "\n") |
| 140 | |
| 141 | def do_GET(self) -> None: |
| 142 | if self.path == "/__cn1__/probe.js": |
| 143 | payload = PROBE_JS.encode("utf-8") |
| 144 | self.send_response(200) |
| 145 | self.send_header("Content-Type", "application/javascript; charset=utf-8") |
| 146 | self.send_header("Content-Length", str(len(payload))) |
| 147 | self.end_headers() |
| 148 | self.wfile.write(payload) |
| 149 | return |
| 150 | if self.path == "/__cn1__/health": |
| 151 | payload = json.dumps({"ready": True}).encode("utf-8") |
| 152 | self.send_response(200) |
| 153 | self.send_header("Content-Type", "application/json; charset=utf-8") |
| 154 | self.send_header("Content-Length", str(len(payload))) |
| 155 | self.end_headers() |
| 156 | self.wfile.write(payload) |
| 157 | return |
| 158 | super().do_GET() |
| 159 | |
| 160 | def do_POST(self) -> None: |
| 161 | if self.path != "/__cn1__/log": |