summaryrefslogtreecommitdiff
path: root/lib/libfetch/http.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libfetch/http.c')
-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 04b7964612fe..3c9e61b592ce 100644
--- a/lib/libfetch/http.c
+++ b/lib/libfetch/http.c
@@ -946,10 +946,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 (code == HTTP_OK || code == HTTP_PARTIAL || HTTP_ERROR(code))
- break;
-
/* we need to provide authentication */
if (code == HTTP_NEED_AUTH) {
need_auth = 1;
@@ -957,6 +953,10 @@ _http_request(struct url *URL, const char *op, struct url_stat *us,
fd = -1;
continue;
}
+
+ /* we have a hit or an error */
+ if (code == HTTP_OK || code == HTTP_PARTIAL || HTTP_ERROR(code))
+ break;
/* all other cases: we got a redirect */
need_auth = 0;