Skip to content

fix http client redirects (broken from const String& changes) #6786

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

Merged
merged 3 commits into from
Nov 18, 2019

Conversation

liebman
Copy link
Contributor

@liebman liebman commented Nov 16, 2019

remove clear() before beginInternal() so _location is not cleared before its passed to beginInternal()

Fixes #6778

@earlephilhower
Copy link
Collaborator

@liebman I'm not sure I understand the reference in the PR title. The line you're removing is from e46ccae which is about 8 months old (the ::clear hasn't been touched in years).

@liebman
Copy link
Contributor Author

liebman commented Nov 18, 2019

@earlephilhower see this comment in the related issue #6778 (comment). A subsequent change made the parameter to setURL a reference and in the follow redirects case _location, which is set to an empty string in clear() is passed to setURL, clear() is called and the redirect location was lost.

Copy link
Collaborator

@earlephilhower earlephilhower left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation. This is a class that's collected a lot of cruft over the years, so I'm sure there are other things waiting in the wings.

@earlephilhower earlephilhower added this to the 2.6.2 milestone Nov 18, 2019
@devyte devyte merged commit bbfe2c2 into esp8266:master Nov 18, 2019
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.

redirect location gets cleared in setURL(const String& url) function of ESP8266HTTPClient.cpp
3 participants