fetch/http: add missing case when treating status code.

The HTTP_REDIRECT() macro already included this case, but the
switch-case with the return value of http_get_reply(conn) didn't. This
made it so that a server returning HTTP_TEMP_REDIRECT (307) would
generate a failure, unless libfetch was used in verbose mode, in which
case the headers would be parsed (in order to report errors), then the
'Location' header would be found and a new connection would be made.

Fixes #348
This commit is contained in:
Érico Rolim 2020-11-22 17:15:41 -03:00 committed by Duncan Overbruck
parent 2047dac6a0
commit 9c5443d134
No known key found for this signature in database
GPG Key ID: 335C1D17EC3D6E35

View File

@ -1021,6 +1021,7 @@ http_request(struct url *URL, const char *op, struct url_stat *us,
case HTTP_MOVED_TEMP:
case HTTP_SEE_OTHER:
case HTTP_USE_PROXY:
case HTTP_TEMP_REDIRECT:
/*
* Not so fine, but we still have to read the
* headers to get the new location.