{"record":{"id":"9fd7faf6b82985f3","repo":"diegosouzapw/OmniRoute","slug":"remote-media-requires-https-at-every-redirect-hop","errorCode":null,"errorMessage":"Remote media requires HTTPS at every redirect hop","messagePattern":"Remote media requires HTTPS at every redirect hop","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/network/remoteImageFetch.ts","lineNumber":59,"sourceCode":"}\n\nexport interface RemoteImageFetchResult {\n  buffer: Buffer<ArrayBuffer>;\n  contentType: string;\n  url: string;\n}\n\n/** Generic aliases for non-image callers that need the same SSRF/bounds policy. */\nexport type RemoteMediaFetchOptions = RemoteImageFetchOptions;\nexport type RemoteMediaFetchResult = RemoteImageFetchResult;\n\nfunction validateRemoteImageUrl(input: string | URL, guard: OutboundUrlGuardMode) {\n  return guard === \"public-only\" ? parseAndValidatePublicUrl(input) : parseOutboundUrl(input);\n}\n\nfunction requireHttps(url: URL, enabled: boolean): URL {\n  if (enabled && url.protocol !== \"https:\") {\n    throw new Error(\"Remote media requires HTTPS at every redirect hop\");\n  }\n  return url;\n}\n\nconst defaultLookup: RemoteImageLookup = (hostname) => dns.promises.lookup(hostname, { all: true });\n\n/** Resolve every answer, reject the host if any answer is private, then return\n * the validated addresses so the caller can bind the connection to one of them. */\nasync function assertHostnameResolvesPublic(\n  url: URL,\n  guard: OutboundUrlGuardMode,\n  lookup: RemoteImageLookup\n): Promise<Array<{ address: string; family: number }>> {\n  if (guard !== \"public-only\") return [];\n  const hostname = url.hostname;\n  const bare =\n    hostname.startsWith(\"[\") && hostname.endsWith(\"]\") ? hostname.slice(1, -1) : hostname;\n  if (!bare) return [];","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/network/remoteImageFetch.ts#L41-L77","documentation":"Error \"Remote media requires HTTPS at every redirect hop\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/shared/network/remoteImageFetch.ts:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}