mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-23 14:51:27 +02:00
MINOR: h1-htx: Set the flag HTX_SL_F_HAS_AUTHORITY during the request parsing
When an h1 request is received and parsed, this flag is set if it is a CONNECT request or if an absolute URI is detected.
This commit is contained in:
parent
16fdc55f79
commit
fe451fb9ef
10
src/h1_htx.c
10
src/h1_htx.c
@ -193,10 +193,12 @@ static int h1_postparse_req_hdrs(struct h1m *h1m, union h1_sl *h1sl, struct htx
|
|||||||
goto error;
|
goto error;
|
||||||
sl->info.req.meth = h1sl->rq.meth;
|
sl->info.req.meth = h1sl->rq.meth;
|
||||||
|
|
||||||
/* Check if the uri contains an explicit scheme and if it is
|
/* Check if the uri contains an authority. Also check if it contains an
|
||||||
* "http" or "https". */
|
* explicit scheme and if it is "http" or "https". */
|
||||||
if (uri.len && uri.ptr[0] != '/') {
|
if (h1sl->rq.meth == HTTP_METH_CONNECT)
|
||||||
sl->flags |= HTX_SL_F_HAS_SCHM;
|
sl->flags |= HTX_SL_F_HAS_AUTHORITY;
|
||||||
|
else if (uri.len && uri.ptr[0] != '/' && uri.ptr[0] != '*') {
|
||||||
|
sl->flags |= (HTX_SL_F_HAS_AUTHORITY|HTX_SL_F_HAS_SCHM);
|
||||||
if (uri.len > 4 && (uri.ptr[0] | 0x20) == 'h')
|
if (uri.len > 4 && (uri.ptr[0] | 0x20) == 'h')
|
||||||
sl->flags |= ((uri.ptr[4] == ':') ? HTX_SL_F_SCHM_HTTP : HTX_SL_F_SCHM_HTTPS);
|
sl->flags |= ((uri.ptr[4] == ':') ? HTX_SL_F_SCHM_HTTP : HTX_SL_F_SCHM_HTTPS);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user