diegosouzapw/OmniRoute · error · Error
Invalid request URL
Error message
Invalid request URL
What it means
Guard in the inspector HTTP proxy's request handler: safeUrl(req.url, req.headers.host) returned null — the request line's URL plus the Host header could not be combined into a parseable absolute URL. Means the client sent a malformed request-target/Host combination (or garbage bytes parsed as a request), so no upstream target can be derived and the interception entry is failed. The inputs at fault are the raw req.url and req.headers.host.
Solutions
- Log the raw req.url/Host pair to see what the client actually sent
- Confirm the client speaks plain HTTP proxy semantics (or CONNECT for TLS)
- Drop the connection — retrying the same malformed request will fail identically
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/mitm/inspector/httpProxyServer.ts:116 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/37129075fa231908.
Report an issue: GitHub.
Appendix: source
Thrown at src/mitm/inspector/httpProxyServer.ts:116
method: req.method ?? "GET",
host: req.headers.host ?? "",
path: req.url ?? "/",
requestHeaders: sanitizeHeaders(req.headers),
requestBody: null,
requestSize: 0,
responseHeaders: {},
responseBody: null,
responseSize: 0,
status: "in-flight",
};
globalTrafficBuffer.push(intercepted);
void (async () => {
try {
const target = safeUrl(req.url, req.headers.host);
if (!target) {
throw new Error("Invalid request URL");
}
intercepted.host = target.host;
intercepted.path = target.pathname + target.search;
const body = await readBody(req);
intercepted.requestSize = body.length;
intercepted.requestBody = body.length > 0 ? maskSecret(body.toString("utf8")) : null;
const upstreamHeaders = buildFetchHeaders(req.headers);
const upstream = await fetch(target.toString(), {
method: req.method ?? "GET",
headers: upstreamHeaders,
body: body.length > 0 ? body : undefined,
redirect: "manual",
});
const respBuf = Buffer.from(await upstream.arrayBuffer());
const totalLatencyMs = performance.now() - startedAt;View on GitHub (pinned to a179ffed5b)