Skip to content

SNOW-2181459 Update HttpClient to use LaxRedirectStrategy to handle 307 on POST#2311

Open
frosforever wants to merge 1 commit intosnowflakedb:masterfrom
frosforever:patch-1
Open

SNOW-2181459 Update HttpClient to use LaxRedirectStrategy to handle 307 on POST#2311
frosforever wants to merge 1 commit intosnowflakedb:masterfrom
frosforever:patch-1

Conversation

@frosforever
Copy link
Copy Markdown

@frosforever frosforever commented Aug 15, 2025

Currently used DefaultRedirectStrategy will not redirect on POST requests when a 307 is received. LaxRedirectStrategy, on the other hand, will accept redirects regardless of the method.

Snowflake service sometimes returns 307 on POST. Discussions with support indicated that while this shouldn't happen it can be returned to the client and should be retried in user code. If the retry strategy in the http client is updated to LaxRedirectStrategy there would be no need for users to handle this explicitly.

Overview

SNOW-XXXXX

Pre-review self checklist

  • PR branch is updated with all the changes from master branch
  • The code is correctly formatted (run mvn -P check-style validate)
  • New public API is not unnecessary exposed (run mvn verify and inspect target/japicmp/japicmp.html)
  • The pull request name is prefixed with SNOW-XXXX:
  • Code is in compliance with internal logging requirements

External contributors - please answer these questions before submitting a pull request. Thanks!

  1. What GitHub issue is this PR addressing? Make sure that there is an accompanying issue to your PR.

    Issue: This is both the report and the solution to an issue.

  2. Fill out the following pre-review checklist:

    • I am adding a new automated test(s) to verify correctness of my new code
    • I am adding new logging messages
    • I am modifying authorization mechanisms
    • I am adding new credentials
    • I am modifying OCSP code
    • I am adding a new dependency or upgrading an existing one
    • I am adding new public/protected component not marked with @SnowflakeJdbcInternalApi (note that public/protected methods/fields in classes marked with this annotation are already internal)
  3. Please describe how your code solves the related issue.

    Please write a short description of how your code change solves the related issue.

@frosforever frosforever requested a review from a team as a code owner August 15, 2025 15:51
@github-actions
Copy link
Copy Markdown

github-actions bot commented Aug 15, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@frosforever
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@sfc-gh-dszmolka sfc-gh-dszmolka changed the title Update HttpClient to use LaxRedirectStrategy to handle 307 on POST SNOW-2181459 Update HttpClient to use LaxRedirectStrategy to handle 307 on POST Aug 15, 2025
Currently used `DefaultRedirectStrategy` will not redirect on `POST` requests when a `307` is received. `LaxRedirectStrategy`, on the other hand, will accept redirects regardless of the method. 

Snowflake service sometimes returns `307` on `POST`. Discussions with support indicated that while this shouldn't happen it can be returned to the client and should be retried in user code. If the retry strategy in the http client is updated to `LaxRedirectStrategy` there would be no need for users to handle this explicitly.
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.

1 participant