diegosouzapw/OmniRoute · error · SafeOutboundFetchError
REDIRECT_BLOCKED
REDIRECT_BLOCKED
Error message
Redirect blocked for ${method} ${targetUrl.toString()} (${response.status}) What it means
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.
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at src/shared/network/safeOutboundFetch.ts:322 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/b72f32c97816c600.
Report an issue: GitHub.
Appendix: source
Thrown at src/shared/network/safeOutboundFetch.ts:322
...fetchOptions,
method,
redirect,
signal,
timeoutMs,
// When bypassing the proxy patch, use the original native fetch directly.
fetchFn: bypassProxyPatch ? getOriginalFetch() : undefined,
});
const response = bypassProxyPatch
? await executeFetch()
: proxyConfig
? await runWithProxyContext(proxyConfig, executeFetch)
: await executeFetch();
if (!allowRedirect && response.status >= 300 && response.status < 400) {
const location = response.headers.get("location");
await cancelResponseBody(response);
throw new SafeOutboundFetchError(
`Redirect blocked for ${method} ${targetUrl.toString()} (${response.status})`,
{
code: "REDIRECT_BLOCKED",
url: targetUrl.toString(),
method,
attempts: attempt,
status: response.status,
location,
isRetryable: false,
}
);
}
if (
retryConfig.shouldRetryMethod &&
attempt < retryConfig.attempts &&
retryConfig.statusCodes.has(response.status)
) {View on GitHub (pinned to a179ffed5b)