summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-09-23 19:41:10 +0000
committerLaurent Bercot <ska@appnovation.com>2023-09-23 19:41:10 +0000
commitfe95ed0a9f701f6ca076b403c0b2bf6cf15a8174 (patch)
tree7306042cf7f12bedaebf0e1202cfaa3697fe7e1b /src
parent4a4bd72e3d2f7b165677435f3656a5034e8342d9 (diff)
downloadtipidee-fe95ed0a9f701f6ca076b403c0b2bf6cf15a8174.tar.xz
Only check Location for 301, 302, 307 and 308
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src')
-rw-r--r--src/tipideed/cgi.c4
1 files changed, 2 insertions, 2 deletions
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") ;
}