{"record":{"id":"b72f32c97816c600","repo":"diegosouzapw/OmniRoute","slug":"redirect-blocked","errorCode":"REDIRECT_BLOCKED","errorMessage":"Redirect blocked for ${method} ${targetUrl.toString()} (${response.status})","messagePattern":"Redirect blocked for (.+?) (.+?) \\((.+?)\\)","errorType":"http","errorClass":"SafeOutboundFetchError","httpStatus":null,"severity":"error","filePath":"src/shared/network/safeOutboundFetch.ts","lineNumber":322,"sourceCode":"          ...fetchOptions,\n          method,\n          redirect,\n          signal,\n          timeoutMs,\n          // When bypassing the proxy patch, use the original native fetch directly.\n          fetchFn: bypassProxyPatch ? getOriginalFetch() : undefined,\n        });\n\n      const response = bypassProxyPatch\n        ? await executeFetch()\n        : proxyConfig\n          ? await runWithProxyContext(proxyConfig, executeFetch)\n          : await executeFetch();\n\n      if (!allowRedirect && response.status >= 300 && response.status < 400) {\n        const location = response.headers.get(\"location\");\n        await cancelResponseBody(response);\n        throw new SafeOutboundFetchError(\n          `Redirect blocked for ${method} ${targetUrl.toString()} (${response.status})`,\n          {\n            code: \"REDIRECT_BLOCKED\",\n            url: targetUrl.toString(),\n            method,\n            attempts: attempt,\n            status: response.status,\n            location,\n            isRetryable: false,\n          }\n        );\n      }\n\n      if (\n        retryConfig.shouldRetryMethod &&\n        attempt < retryConfig.attempts &&\n        retryConfig.statusCodes.has(response.status)\n      ) {","sourceCodeStart":304,"sourceCodeEnd":340,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/network/safeOutboundFetch.ts#L304-L340","documentation":"SafeOutboundFetchError thrown when a 3xx response is received while redirects are not allowed for the request (allowRedirect false / redirect policy set to manual-follow-off). The message names the method, target URL, and redirect status so the caller knows the hop that was refused.","triggerScenarios":"Thrown at src/shared/network/safeOutboundFetch.ts:322 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass the final post-redirect URL directly instead of relying on redirect following","Enable redirects in SafeOutboundFetchOptions if following is intended and safe","Have the upstream stop redirecting (update the endpoint/canonical URL)","Re-issue the request manually against the Location header if the policy is custom"],"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"}