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

Function parseUrlPath

scripts/static-server.mjs:386–395  ·  view source on GitHub ↗
(req, res)

Source from the content-addressed store, hash-verified

384// ─────────────────────────────────────────────────────────────────────────────
385
386function parseUrlPath(req, res) {
387 const rawPath = (req.url ?? "/").split("?")[0];
388 try {
389 return decodeURIComponent(rawPath);
390 } catch {
391 res.writeHead(400);
392 res.end("Bad Request");
393 return null;
394 }
395}
396
397function isGetOrHead(req) {
398 return req.method === "GET" || req.method === "HEAD";

Callers 1

handleStaticFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected