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

optionally allow redirects on HTTPClient & OTA updates #5009

Merged
merged 53 commits into from Mar 13, 2019

Conversation

liebman
Copy link
Contributor

@liebman liebman commented Aug 5, 2018

Support is disabled by default. Call ESPhttpUpdate.followRedirects(true); to enable.

@d-a-v
Copy link
Collaborator

d-a-v commented Nov 1, 2018

Redirection code is currently handled in ESP8266httpUpdate.cpp in your PR.
I was wondering why not moving it straight into ESP8266HTTPClient.cpp ?
After a discussion with @earlephilhower, this is doable if the protocol does not change after redirection (http vs https).
If it changes (security involved), then you can return the same code as before (301 or 302).
What do you think ?

only GET and HEAD requests are currently handled automatically
Redirects that fail to be automatically handled return the redirect code as before
@liebman
Copy link
Contributor Author

liebman commented Nov 4, 2018

@d-a-v Its still a work in progress but its functional. Before I clean up a few optional TBDs I want to see what others think. Also I'm thinking of allowing redirects for POST requests by turning them into GET requests at the new location if redirects are enabled. (https://en.wikipedia.org/wiki/Post/Redirect/Get)

@liebman
Copy link
Contributor Author

liebman commented Nov 8, 2018

@d-a-v Updated. Added support for POST 303 redirect. Also added device tests for various redirect features.

@liebman liebman changed the title optionally allow redirects on http OTA updates optionally allow redirects on HTTPClient & OTA updates Dec 16, 2018
liebman and others added 21 commits December 16, 2018 06:03
@liebman
Copy link
Contributor Author

liebman commented Mar 9, 2019

@d-a-v any more changes needed?

Copy link
Collaborator

@d-a-v d-a-v left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@d-a-v d-a-v requested a review from devyte March 10, 2019 17:50
Copy link
Collaborator

@devyte devyte left a comment

Choose a reason for hiding this comment

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

Nothing noteworthy jumps out at me code-wise.
Approved.

@d-a-v d-a-v merged commit e46ccae into esp8266:master Mar 13, 2019
@liebman liebman deleted the feature/http_update_follow_redirects branch September 10, 2019 20:12
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.

None yet

4 participants