framework
Version:
The (AI) Framework: turnkey, zero-config AI orchestration that wraps a coding-agent CLI (Claude Code) as a black box and takes you from an idea to a running app. Vite for AI.
16 lines • 627 B
JavaScript
/**
* A request's pathname, parsed defensively (#938). Node hands the request target through
* verbatim, including absolute-form targets a proxy client may send (`GET http://[ ...`),
* and `new URL` throws on those synchronously inside the request handler — an uncaught
* exception that takes the whole daemon down. `undefined` means "no parseable path":
* answer 400 (or serve the fallback), never throw.
*/
export function requestPathname(req) {
try {
return new URL(req.url ?? '/', 'http://localhost').pathname;
}
catch {
return undefined;
}
}
//# sourceMappingURL=request-path.js.map