From 106fb1fefe19b26bf51d5f5a28146daa42b7b0c8 Mon Sep 17 00:00:00 2001 From: eadler Date: Mon, 22 Oct 2012 03:00:15 +0000 Subject: Implement HTTP 305 redirect handling. PR: 172452 Submitted by: gcooper Reviewed by: des Approved by: cperciva MFC after: 1 week --- lib/libfetch/http.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/libfetch/http.c') diff --git a/lib/libfetch/http.c b/lib/libfetch/http.c index a1166bc..00dd887 100644 --- a/lib/libfetch/http.c +++ b/lib/libfetch/http.c @@ -103,6 +103,7 @@ __FBSDID("$FreeBSD$"); #define HTTP_MOVED_TEMP 302 #define HTTP_SEE_OTHER 303 #define HTTP_NOT_MODIFIED 304 +#define HTTP_USE_PROXY 305 #define HTTP_TEMP_REDIRECT 307 #define HTTP_PERM_REDIRECT 308 #define HTTP_NEED_AUTH 401 @@ -113,6 +114,7 @@ __FBSDID("$FreeBSD$"); #define HTTP_REDIRECT(xyz) ((xyz) == HTTP_MOVED_PERM \ || (xyz) == HTTP_MOVED_TEMP \ || (xyz) == HTTP_TEMP_REDIRECT \ + || (xyz) == HTTP_USE_PROXY \ || (xyz) == HTTP_SEE_OTHER) #define HTTP_ERROR(xyz) ((xyz) > 400 && (xyz) < 599) @@ -1697,6 +1699,7 @@ http_request(struct url *URL, const char *op, struct url_stat *us, case HTTP_MOVED_PERM: case HTTP_MOVED_TEMP: case HTTP_SEE_OTHER: + case HTTP_USE_PROXY: /* * Not so fine, but we still have to read the * headers to get the new location. @@ -1778,7 +1781,8 @@ http_request(struct url *URL, const char *op, struct url_stat *us, */ if (noredirect && conn->err != HTTP_MOVED_PERM && - conn->err != HTTP_PERM_REDIRECT) { + conn->err != HTTP_PERM_REDIRECT && + conn->err != HTTP_USE_PROXY) { n = 1; break; } -- cgit v1.1