From fe95ed0a9f701f6ca076b403c0b2bf6cf15a8174 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Sat, 23 Sep 2023 19:41:10 +0000 Subject: Only check Location for 301, 302, 307 and 308 Signed-off-by: Laurent Bercot --- src/tipideed/cgi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/tipideed') diff --git a/src/tipideed/cgi.c b/src/tipideed/cgi.c index c2c62a1..3a9234c 100644 --- a/src/tipideed/cgi.c +++ b/src/tipideed/cgi.c @@ -305,8 +305,8 @@ static inline int process_cgi_output (tipidee_rql *rql, tipidee_headers const *h if (!m || (x[m] && x[m] != ' ')) die502x(rql, 2, "cgi ", cginame, " returned an invalid ", "Status", " header") ; reason_phrase = x[m] ? x + m + 1 : "" ; - if (status >= 300 && status < 399 && !location) - die502x(rql, 2, "cgi ", cginame, " returned a 3xx status code without a ", "Location", " header") ; + if (!location && (status == 301 || status == 302 || status == 307 || status == 308)) + die502x(rql, 2, "cgi ", cginame, " returned a redirection status code without a ", "Location", " header") ; if (status < 100 || status > 999) die502x(rql, 2, "cgi ", cginame, " returned an invalid ", "Status", " value") ; } -- cgit v1.2.3