From: Amaury Denoyelle Date: Wed, 7 Jul 2021 08:49:27 +0000 (+0200) Subject: MEDIUM: h1-htx: apply scheme-based normalization on h1 requests X-Git-Tag: v2.5-dev2~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=852d78c23280729295aedebfd3d5b9ee72f7d07a;p=thirdparty%2Fhaproxy.git MEDIUM: h1-htx: apply scheme-based normalization on h1 requests Apply the rfc 3986 scheme-based normalization on h1 requests. It is executed only for requests which uses absolute-form target URI, which is not the standard case. --- diff --git a/src/h1_htx.c b/src/h1_htx.c index 6ff69d0aa6..70e4b2cb01 100644 --- a/src/h1_htx.c +++ b/src/h1_htx.c @@ -16,6 +16,7 @@ #include #include #include +#include #include #include @@ -191,6 +192,10 @@ static int h1_postparse_req_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx sl->flags |= (HTX_SL_F_HAS_AUTHORITY|HTX_SL_F_HAS_SCHM); if (uri.len > 4 && (uri.ptr[0] | 0x20) == 'h') sl->flags |= ((uri.ptr[4] == ':') ? HTX_SL_F_SCHM_HTTP : HTX_SL_F_SCHM_HTTPS); + + /* absolute-form target URI present, proceed to scheme-based + * normalization */ + http_scheme_based_normalize(htx); } /* If body length cannot be determined, set htx->extra to