From 00009e3ca4207bf2aeed1eb2b78b33bcc987da02 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Sun, 8 Dec 2024 12:42:27 +0100 Subject: [PATCH] [http] Redirect also for 308. Refs #343 --- src/protocol/http/codes.c | 1 + src/protocol/http/http.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/protocol/http/codes.c b/src/protocol/http/codes.c index 209488d01..9c507eb3b 100644 --- a/src/protocol/http/codes.c +++ b/src/protocol/http/codes.c @@ -51,6 +51,7 @@ static const struct http_code http_code[] = { { 305, "Use Proxy" }, { 306, "(Unused)" }, { 307, "Temporary Redirect" }, + { 308, "Permanent Redirect" }, { 400, "Bad Request" }, { 401, "Unauthorized" }, { 402, "Payment Required" }, diff --git a/src/protocol/http/http.c b/src/protocol/http/http.c index 78e9b9176..02631610a 100644 --- a/src/protocol/http/http.c +++ b/src/protocol/http/http.c @@ -1693,7 +1693,7 @@ again: /* XXX: Is there some reason why NOT to follow the Location header * for any status? If the server didn't mean it, it wouldn't send * it, after all...? --pasky */ - if (h == 201 || h == 301 || h == 302 || h == 303 || h == 307) { + if (h == 201 || h == 301 || h == 302 || h == 303 || h == 307 || h == 308) { d = parse_header(conn->cached->head, "Location", NULL); if (d) { int use_get_method = (h == 303);