]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h2: report in the HTX flags when the request has an authority
authorWilly Tarreau <w@1wt.eu>
Tue, 8 Oct 2019 15:34:50 +0000 (17:34 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 9 Oct 2019 09:10:19 +0000 (11:10 +0200)
The other side will need to know when to emit an authority or not. We
need to pass this information in the HTX flags.

src/h2.c

index 80bc8e0746143cea3f4b5a3977ebecc2c29f1dc1..254d977192117ef6ddf78ce6762cbb96aa16e671 100644 (file)
--- a/src/h2.c
+++ b/src/h2.c
@@ -215,6 +215,7 @@ static struct htx_sl *h2_prepare_htx_reqline(uint32_t fields, struct ist *phdr,
        if (!(flags & HTX_SL_F_HAS_SCHM)) {
                /* no scheme, use authority only (CONNECT) */
                uri = phdr[H2_PHDR_IDX_AUTH];
+               flags |= HTX_SL_F_HAS_AUTHORITY;
        }
        else if (!(flags & (HTX_SL_F_SCHM_HTTP|HTX_SL_F_SCHM_HTTPS)) && (fields & H2_PHDR_FND_AUTH)) {
                /* non-http/https scheme + authority, let's use the absolute
@@ -227,10 +228,13 @@ static struct htx_sl *h2_prepare_htx_reqline(uint32_t fields, struct ist *phdr,
                istcat(&uri, phdr[H2_PHDR_IDX_AUTH], trash.size);
                if (!isteq(phdr[H2_PHDR_IDX_PATH], ist("*")))
                        istcat(&uri, phdr[H2_PHDR_IDX_PATH], trash.size);
+               flags |= HTX_SL_F_HAS_AUTHORITY;
        }
        else {
                /* usual schemes with or without authority, use origin form */
                uri = phdr[H2_PHDR_IDX_PATH];
+               if (fields & H2_PHDR_FND_AUTH)
+                       flags |= HTX_SL_F_HAS_AUTHORITY;
        }
 
        /* make sure the final URI isn't empty. Note that 7540#8.1.2.3 states