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

Function parseUrlPath

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

Source from the content-addressed store, hash-verified

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

Callers 1

handleStaticFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected