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

Function parseUrlPath

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

Source from the content-addressed store, hash-verified

508// ─────────────────────────────────────────────────────────────────────────────
509
510function parseUrlPath(req, res) {
511 const rawPath = (req.url ?? "/").split("?")[0];
512 try {
513 return decodeURIComponent(rawPath);
514 } catch {
515 res.writeHead(400);
516 res.end("Bad Request");
517 return null;
518 }
519}
520
521function isGetOrHead(req) {
522 return req.method === "GET" || req.method === "HEAD";

Callers 1

handleStaticFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected