MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / writeInvalidBackendUrlResponse

Function writeInvalidBackendUrlResponse

scripts/proxy-utils.mjs:54–63  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

52}
53
54function writeInvalidBackendUrlResponse(req, res) {
55 const message = "Invalid backend URL";
56 console.error(`Proxy error for ${req.url}: ${message}`);
57 if (!res.headersSent) {
58 res.writeHead(502, { "Content-Type": "text/plain; charset=utf-8" });
59 res.end(`Bad Gateway: ${message}`);
60 } else {
61 res.destroy();
62 }
63}
64
65export function isServerInfoRequest(req) {
66 const pathname = new URL(req.url ?? "/", "http://localhost").pathname;

Callers 1

proxyServerInfoRequestFunction · 0.85

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected