webclient: 304 and 305 are not really redirects

Eg. The docker API sometimes returns 304 even for requests without etags.
https://docs.docker.com/engine/api/v1.40/#operation/ContainerStop
This commit is contained in:
YAMAMOTO Takashi 2021-04-07 10:59:28 +09:00 committed by Xiang Xiao
parent 15c65b23c7
commit 2d0a174cec

View file

@ -423,9 +423,15 @@ static inline int wget_parsestatus(struct webclient_context *ctx,
/* Check for 3xx (Redirection)
* Location: header line will contain the new location.
*
* Note: the following 3xx are not redirects.
* 304 not modified
* 305 use proxy
*/
else if ((http_status / 100) == 3)
else if ((http_status / 100) == 3 &&
(http_status != 304) &&
(http_status != 305))
{
ws->httpstatus = HTTPSTATUS_MOVED;
}