From 9c5443d134dd23c08017d3dfe6573eaa4be8b9e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Sun, 22 Nov 2020 17:15:41 -0300 Subject: [PATCH] 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 --- lib/fetch/http.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/fetch/http.c b/lib/fetch/http.c index fe98b1a9..395e7d8f 100644 --- a/lib/fetch/http.c +++ b/lib/fetch/http.c @@ -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.