{"record":{"id":"49963dac5e6988d5","repo":"diegosouzapw/OmniRoute","slug":"remote-image-redirect-missing-location-header-r","errorCode":null,"errorMessage":"Remote image redirect missing Location header (${response.status})","messagePattern":"Remote image redirect missing Location header \\((.+?)\\)","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/network/remoteImageFetch.ts","lineNumber":219,"sourceCode":"  for (let redirectCount = 0; redirectCount <= maxRedirects; redirectCount++) {\n    // DNS-rebinding guard: validate every hop's hostname against its resolved\n    // IPs before issuing the request (GHSA-cmhj-wh2f-9cgx).\n    const addresses = await assertHostnameResolvesPublic(currentUrl, guard, lookup);\n    const fetchImpl =\n      injectedFetch ??\n      (pinDns && addresses.length\n        ? createPinnedFetch(addresses[0].address, addresses[0].family)\n        : fetch);\n    const response = await fetchImpl(currentUrl.toString(), {\n      method: \"GET\",\n      redirect: \"manual\",\n      signal,\n    });\n\n    if (response.status >= 300 && response.status < 400) {\n      const location = response.headers.get(\"location\");\n      if (!location) {\n        throw new Error(`Remote image redirect missing Location header (${response.status})`);\n      }\n      if (redirectCount >= maxRedirects) {\n        throw new Error(`Remote image exceeded ${maxRedirects} redirect limit`);\n      }\n      currentUrl = requireHttps(\n        validateRemoteImageUrl(new URL(location, currentUrl), guard),\n        options.enforceHttps === true\n      );\n      continue;\n    }\n\n    if (!response.ok) {\n      throw new Error(`Remote image fetch error ${response.status}`);\n    }\n\n    return {\n      buffer: await readResponseBuffer(response, maxBytes),\n      contentType: response.headers.get(\"content-type\") || \"application/octet-stream\",","sourceCodeStart":201,"sourceCodeEnd":237,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/network/remoteImageFetch.ts#L201-L237","documentation":"Error \"Remote image redirect missing Location header (${response.status})\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/shared/network/remoteImageFetch.ts:219 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"}