Ein Pfad, der dist/ nicht verlassen kann.
(root, urlPath)
| 50 | |
| 51 | /** Ein Pfad, der dist/ nicht verlassen kann. */ |
| 52 | function 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 | |
| 58 | function readBody(req) { |
| 59 | return new Promise((resolveBody, reject) => { |
no test coverage detected