Skip to content

HTTPClient does not set/reset httpCode correctly to 200 but is stuck with 30X till followed too offten and gets 404 #4763

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

Closed
DEvil0000 opened this issue Feb 1, 2021 · 1 comment

Comments

@DEvil0000
Copy link

DEvil0000 commented Feb 1, 2021

What you are trying to do?
I try to follow https://github.com/wolf128058/esp32-led-matrix/releases/latest/download/version.txt to download it's payload.
Describe what is failing.
HTTPClient follows till the final URL but when it should have a 200 and return the payload it tries to follow once more and gets a 404 after that. Looks like the http return code is not reset when the HTTPClient gets reused internally on the follow.
Show the shortest possible code that will duplicate the error.

        http.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS);
        http.begin(client, url);     // Webseite aufrufen

Hardware:

Board: ESP32 Dev Module
Core Installation version: 1.0.5-rc6
IDE name: Platform.io
Upload Speed: 115200
Computer OS: Ubuntu

Description:

guess I did that above.
Not reusing the connection (no follow) works.

@me-no-dev
Copy link
Member

Done :) It was actually redirecting to a new host, but the old connection was not disconnected first, so it asked the same server for non-existing URL

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

No branches or pull requests

2 participants