Skip to content
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

Fix error reading closed response body on redirect #6372

Merged
merged 1 commit into from
Sep 10, 2019

Conversation

danielnelson
Copy link
Contributor

Since we were not using the sigil error in CheckRedirect, an error was set and the response body closed. However since redirects don't return from the error condition, there were follow on errors later reading the response body. With the http.ErrUseLastResponse error we can simplify this a bit and the response body will not be closed.

Removed test used knowledge of the prior behavior to inject a read error, this method will no longer work and will require larger refactoring to reintroduce the case.

close #6366

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

@danielnelson danielnelson added the fix pr to fix corresponding bug label Sep 9, 2019
@danielnelson danielnelson added this to the 1.12.1 milestone Sep 9, 2019
@danielnelson danielnelson merged commit 15dd433 into master Sep 10, 2019
@danielnelson danielnelson deleted the fix-http-response-redirects branch September 10, 2019 18:04
danielnelson added a commit that referenced this pull request Sep 10, 2019
bitcharmer pushed a commit to bitcharmer/telegraf that referenced this pull request Oct 18, 2019
athoune pushed a commit to bearstech/telegraf that referenced this pull request Apr 17, 2020
idohalevi pushed a commit to idohalevi/telegraf that referenced this pull request Sep 29, 2020
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
arstercz pushed a commit to arstercz/telegraf that referenced this pull request Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

http_response regression when not following redirects
1 participant