]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: h1-htx: Return the right reason for 302 FCGI responses
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 20 Jul 2023 07:50:56 +0000 (09:50 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 20 Jul 2023 07:51:00 +0000 (09:51 +0200)
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.

src/h1_htx.c

index 81977e8ad8d49862417a8cbb90f191586d2159b1..d913fe17bc03c58bd136c8532b2b173d13bca2e2 100644 (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) {