{"record":{"id":"306979f18531382a","repo":"diegosouzapw/OmniRoute","slug":"invalid-url","errorCode":"INVALID_URL","errorMessage":"Invalid outbound URL: ${String(input)}","messagePattern":"Invalid outbound URL: (.+?)","errorType":"validation","errorClass":"SafeOutboundFetchError","httpStatus":null,"severity":"error","filePath":"src/shared/network/safeOutboundFetch.ts","lineNumber":161,"sourceCode":"function normalizeMethod(method?: string) {\n  return (method || \"GET\").toUpperCase();\n}\n\nfunction normalizeUrl(input: string | URL) {\n  try {\n    return parseOutboundUrl(input);\n  } catch (error) {\n    if (error instanceof OutboundUrlGuardError) {\n      throw new SafeOutboundFetchError(error.message, {\n        code: error.code === \"OUTBOUND_URL_INVALID\" ? \"INVALID_URL\" : \"URL_GUARD_BLOCKED\",\n        url: error.url,\n        method: \"GET\",\n        attempts: 1,\n        isRetryable: false,\n        cause: error,\n      });\n    }\n    throw new SafeOutboundFetchError(`Invalid outbound URL: ${String(input)}`, {\n      code: \"INVALID_URL\",\n      url: String(input),\n      method: \"GET\",\n      attempts: 1,\n      isRetryable: false,\n      cause: error,\n    });\n  }\n}\n\nfunction applyUrlGuard(targetUrl: URL, guard: SafeOutboundFetchGuard, method: string) {\n  if (guard === \"none\") return;\n\n  try {\n    // \"public-only\" rejects every private host; \"block-metadata\" (#5066) allows private/LAN\n    // hosts but still rejects cloud-metadata / link-local endpoints.\n    if (guard === \"block-metadata\") {\n      parseAndValidateNonMetadataUrl(targetUrl);","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/network/safeOutboundFetch.ts#L143-L179","documentation":"SafeOutboundFetchError wrapping a URL that failed validation before any request was made. normalizeUrl() maps OutboundUrlGuardError from parseOutboundUrl (invalid or policy-blocked URL) into code INVALID_URL/URL_GUARD_BLOCKED, and constructs this same message for any other invalid input. Not retryable.","triggerScenarios":"Thrown at src/shared/network/safeOutboundFetch.ts:161 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the URL string passed to safeFetch — ensure it parses and uses http/https","Remove embedded userinfo credentials from the URL","If blocked by policy (private host), adjust the outbound URL guard opt-ins or use a public endpoint","Inspect error.code to distinguish parse failure (INVALID_URL) from policy block (URL_GUARD_BLOCKED)"],"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"}