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

Function parseUrlPath

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

Source from the content-addressed store, hash-verified

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

Callers 1

handleStaticFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected