From a9a5c04c23cc6aed143ac9d0aa9f1709718a3462 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 14 Jun 2019 10:25:47 +0200 Subject: [PATCH] MINOR: h2: Set flags about the request's scheme on the start-line The flag HTX_SL_F_HAS_SCHM is always set because H2 requests have always an explicit scheme. Then, the pseudo-header ":scheme" is tested. If it is set to "http", the flag HTX_SL_F_SCHM_HTTP is set. Otherwise, for all other cases, the flag HTX_SL_F_SCHM_HTTPS is set. For now, it seems reasonable to have a fallback on the scheme "https". --- src/h2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/h2.c b/src/h2.c index 84b8dbe77..9681aca53 100644 --- a/src/h2.c +++ b/src/h2.c @@ -555,6 +555,8 @@ static struct htx_sl *h2_prepare_htx_reqline(uint32_t fields, struct ist *phdr, goto fail; sl->info.req.meth = find_http_meth(phdr[H2_PHDR_IDX_METH].ptr, phdr[H2_PHDR_IDX_METH].len); + sl->flags |= HTX_SL_F_HAS_SCHM; + sl->flags |= (isteqi(phdr[H2_PHDR_IDX_SCHM], ist("http")) ? HTX_SL_F_SCHM_HTTP : HTX_SL_F_SCHM_HTTPS); return sl; fail: return NULL;