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

Function writeInvalidBackendUrlResponse

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

Source from the content-addressed store, hash-verified

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