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

Function parseUrlPath

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

Source from the content-addressed store, hash-verified

448// ─────────────────────────────────────────────────────────────────────────────
449
450function parseUrlPath(req, res) {
451 const rawPath = (req.url ?? "/").split("?")[0];
452 try {
453 return decodeURIComponent(rawPath);
454 } catch {
455 res.writeHead(400);
456 res.end("Bad Request");
457 return null;
458 }
459}
460
461function isGetOrHead(req) {
462 return req.method === "GET" || req.method === "HEAD";

Callers 1

handleStaticFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected