fix: use reader over readcloser, regen cookie-jar #11482
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix: use reader over readcloser, regen cookie-jar
Similar to #11083, some HTTP servers seem to quietly requires the
content-length header in messages sent. Use of Go's ReadCloser does not
allow for the content-length to be sent. As this is for a simple login
the body length will be very small and the more efficient processing of
a closer is not required in this use case.
Moves the creation of the cookie jar as well. On a re-auth, the cookie
was included in the request. Not only does this not make sense it can
cause issues on some APIs where this was not expected. Given the
original request does not contain this it seems safe to remake the
cookie jar, emptying it, for each auth request.
This also adds the ability to see the response body in the event of an
error to gain a bit more details.
fixes: #11478