-
Notifications
You must be signed in to change notification settings - Fork 959
Disable following redirects on UrlConnectionHttpClient #989
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you be more specific about what was changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment why we do this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually exercise this code path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, supportsResponseCode301 and supportsResponseCode302 both trigger it.
supportsResponseCode302 -> testForResponseCode -> stubForMockRequest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without disable leads to test failure:
java.lang.NullPointerException: delegate must not be null.
at software.amazon.awssdk.utils.Validate.paramNotNull(Validate.java:118)
at software.amazon.awssdk.http.AbortableInputStream.<init>(AbortableInputStream.java:35)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 awesome that you added a base-test for this so that we catch it for other implementations!
* Also include a Location header if the request is 3xx in SdkHttpClientTestSuite
9d530e9 to
c279296
Compare
Codecov Report
@@ Coverage Diff @@
## master #989 +/- ##
============================================
- Coverage 55.36% 55.36% -0.01%
+ Complexity 4493 4492 -1
============================================
Files 799 799
Lines 27449 27450 +1
Branches 2220 2220
============================================
Hits 15198 15198
Misses 11533 11533
- Partials 718 719 +1
Continue to review full report at Codecov.
|
Description
Always disable following redirects in UrlConnectionHttpClient since SDK handles redirects manually.
Motivation and Context
Fixes #975
Testing
Fixed unit tests not adding in Location header, which caused software.amazon.awssdk.http.SdkHttpClientTestSuite#supportsResponseCode302 to fail
Types of changes
Checklist
mvn installsucceedsLicense