BUG/MINOR: h1-htx: Return the right reason for 302 FCGI responses

A FCGI response may contain a "Location" header with no status code. In this
case a 302-Found HTTP response must be returned to the client. However,
while the status code is indeed 302, the reason is wrong. "Found" must be
set instead of "Moved Temporarily".

This patch must be backported as far as 2.2. With the commit e3e4e0006
("BUG/MINOR: http: Return the right reason for 302"), this should fix the
issue #2208.
This commit is contained in:
Christopher Faulet 2023-07-20 09:50:56 +02:00
parent bfff46f411
commit 083f917fe2

View File

@ -259,7 +259,7 @@ static int h1_postparse_res_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx
else if (isteqi(hdrs[hdr].n, ist("location"))) {
code = 302;
status = ist("302");
reason = ist("Moved Temporarily");
reason = ist("Found");
}
}
if (!code) {