{"record":{"id":"37129075fa231908","repo":"diegosouzapw/OmniRoute","slug":"invalid-request-url","errorCode":null,"errorMessage":"Invalid request URL","messagePattern":"Invalid request URL","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/mitm/inspector/httpProxyServer.ts","lineNumber":116,"sourceCode":"    method: req.method ?? \"GET\",\n    host: req.headers.host ?? \"\",\n    path: req.url ?? \"/\",\n    requestHeaders: sanitizeHeaders(req.headers),\n    requestBody: null,\n    requestSize: 0,\n    responseHeaders: {},\n    responseBody: null,\n    responseSize: 0,\n    status: \"in-flight\",\n  };\n\n  globalTrafficBuffer.push(intercepted);\n\n  void (async () => {\n    try {\n      const target = safeUrl(req.url, req.headers.host);\n      if (!target) {\n        throw new Error(\"Invalid request URL\");\n      }\n      intercepted.host = target.host;\n      intercepted.path = target.pathname + target.search;\n\n      const body = await readBody(req);\n      intercepted.requestSize = body.length;\n      intercepted.requestBody = body.length > 0 ? maskSecret(body.toString(\"utf8\")) : null;\n\n      const upstreamHeaders = buildFetchHeaders(req.headers);\n      const upstream = await fetch(target.toString(), {\n        method: req.method ?? \"GET\",\n        headers: upstreamHeaders,\n        body: body.length > 0 ? body : undefined,\n        redirect: \"manual\",\n      });\n\n      const respBuf = Buffer.from(await upstream.arrayBuffer());\n      const totalLatencyMs = performance.now() - startedAt;","sourceCodeStart":98,"sourceCodeEnd":134,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/mitm/inspector/httpProxyServer.ts#L98-L134","documentation":"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.","triggerScenarios":"Thrown at src/mitm/inspector/httpProxyServer.ts:116 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}