webclient: Clear WGET_FLAG_GOT_CONTENT_LENGTH for each request

Otherwise, a stale value might be used after a redirection.
This commit is contained in:
YAMAMOTO Takashi 2022-06-06 18:04:06 +09:00 committed by Petro Karashchenko
parent 065a130bc8
commit 610b04fa97

View File

@ -577,7 +577,8 @@ static inline int wget_parsestatus(struct webclient_context *ctx,
*/
ws->state = WEBCLIENT_STATE_HEADERS;
ws->internal_flags &= ~(WGET_FLAG_CHUNKED |
ws->internal_flags &= ~(WGET_FLAG_GOT_CONTENT_LENGTH |
WGET_FLAG_CHUNKED |
WGET_FLAG_GOT_LOCATION);
ndx = 0;
break;