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

Function writeInvalidBackendUrlResponse

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

Source from the content-addressed store, hash-verified

84}
85
86function writeInvalidBackendUrlResponse(req, res) {
87 const message = "Invalid backend URL";
88 console.error(`Proxy error for ${req.url}: ${message}`);
89 if (!res.headersSent) {
90 res.writeHead(502, { "Content-Type": "text/plain; charset=utf-8" });
91 res.end(`Bad Gateway: ${message}`);
92 } else {
93 res.destroy();
94 }
95}
96
97export function isServerInfoRequest(req) {
98 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