Skip to content

Fix async redirect handling regression from FOLLOW_REDIRECTS default#1314

Draft
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-fixes-c69b
Draft

Fix async redirect handling regression from FOLLOW_REDIRECTS default#1314
cursor[bot] wants to merge 1 commit into
mainfrom
cursor/critical-bug-fixes-c69b

Conversation

@cursor

@cursor cursor Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Bug and impact

Commit #1278 (3a6c679a) changed the default FOLLOW_REDIRECTS behavior from "disabled in async mode" to "always true unless explicitly set". This breaks async connectors such as Slack Analytics that rely on intercepting 3xx responses and manually fetching from the Location URL without forwarding source API auth headers (required for pre-signed download URLs).

Concrete trigger: An async admin.analytics.getFile request returns a 307 redirect to a pre-signed storage URL. With followRedirects=true, the HTTP client auto-follows the redirect while still sending the Slack OAuth Authorization header, causing the download to fail (403) and async data collection to break.

ChatGPT Enterprise is unaffected because its connector spec explicitly sets FOLLOW_REDIRECTS=FALSE; Slack Analytics does not.

Root cause

ApiDataRequestHandler changed from .setFollowRedirects(!processingContext.getAsync()) to .orElse(true) when resolving the FOLLOW_REDIRECTS config property.

Fix

Restore the prior default: when FOLLOW_REDIRECTS is unset, follow redirects in sync mode but disable them in async mode so the existing manual redirect-handling block can fetch from Location without auth headers.

Added asyncModeDisablesRedirectFollowingByDefault unit test to lock in the behavior.

Validation

mvn -pl core -am test -Dtest=ApiDataRequestHandlerTest#asyncModeDisablesRedirectFollowingByDefault,ApiDataRequestHandlerTest#handleShouldFollowRedirectManuallyInAsyncMode,ApiDataRequestHandlerTest#handleShouldLetHttpClientFollowRedirectInSyncMode -Dsurefire.failIfNoSpecifiedTests=false

All 3 tests pass.

Open in Web View Automation 

Commit #1278 changed redirect following to default true unless
FOLLOW_REDIRECTS is explicitly set. That broke async connectors (e.g.
Slack Analytics) which rely on intercepting 3xx responses when
FOLLOW_REDIRECTS is not configured.

Restore the prior default: do not follow redirects in async processing
unless FOLLOW_REDIRECTS is explicitly set. Add a unit test that locks
in the behavior.

Co-authored-by: Erik Schultink <eschultink@users.noreply.github.com>
@eschultink

Copy link
Copy Markdown
Member

@aperez-worklytics thoughts? cursor keeps trying to make this change.

I don't think anything OTHER than chatgpt- sends the 307 .. but yeah, question of what behavior should be in default case.

@aperez-worklytics

aperez-worklytics commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

@aperez-worklytics thoughts? cursor keeps trying to make this change.

I don't think anything OTHER than chatgpt- sends the 307 .. but yeah, question of what behavior should be in default case.

IMHO default should be true, which is the value that has as a default the flag followRedirects in the HttpRequest.

That's what we have as default in absence of the env var:

And the only case we want to have to put false is the chatgpt use case. Slack don't use the 307 in the response. I still don't understand why cursor complains about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants