summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libfetch/http.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c
index 99b34ff..3afc5c7 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -985,10 +985,6 @@ _http_request(struct url *URL, const char *op, struct url_stat *us,
}
} while (h > hdr_end);
- /* we have a hit or an error */
- if (conn->err == HTTP_OK || conn->err == HTTP_PARTIAL || HTTP_ERROR(conn->err))
- break;
-
/* we need to provide authentication */
if (conn->err == HTTP_NEED_AUTH) {
e = conn->err;
@@ -998,6 +994,10 @@ _http_request(struct url *URL, const char *op, struct url_stat *us,
continue;
}
+ /* we have a hit or an error */
+ if (conn->err == HTTP_OK || conn->err == HTTP_PARTIAL || HTTP_ERROR(conn->err))
+ break;
+
/* all other cases: we got a redirect */
e = conn->err;
need_auth = 0;
OpenPOWER on IntegriCloud