MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / safeJoin

Function safeJoin

graph-ui/tools/lib/static-proxy.mjs:52–56  ·  view source on GitHub ↗

Ein Pfad, der dist/ nicht verlassen kann.

(root, urlPath)

Source from the content-addressed store, hash-verified

50
51/** Ein Pfad, der dist/ nicht verlassen kann. */
52function safeJoin(root, urlPath) {
53 const decoded = decodeURIComponent(urlPath.split('?')[0]);
54 const candidate = resolve(join(root, normalize(decoded)));
55 return candidate.startsWith(resolve(root)) ? candidate : null;
56}
57
58function readBody(req) {
59 return new Promise((resolveBody, reject) => {

Callers 1

startStaticProxyFunction · 0.85

Calls 1

normalizeFunction · 0.50

Tested by

no test coverage detected