mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-01-30 10:06:43 +00:00
MEDIUM: mux-h2: make use of hpack_encode_path() to encode the path
The HTTP path encoding was open-coded with a HPACK byte matching the "/" or "/index.html" paths. Let's make use of the new functions to avoid this.
This commit is contained in:
parent
eaeeb68f23
commit
907998194b
@ -4077,13 +4077,7 @@ static size_t h2s_htx_bck_make_req_headers(struct h2s *h2s, struct htx *htx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* encode the path, which necessarily is the second one */
|
/* encode the path, which necessarily is the second one */
|
||||||
if (outbuf.data < outbuf.size && isteq(path, ist("/"))) {
|
if (!hpack_encode_path(&outbuf, path)) {
|
||||||
outbuf.area[outbuf.data++] = 0x84; // indexed field : idx[04]=(":path", "/")
|
|
||||||
}
|
|
||||||
else if (outbuf.data < outbuf.size && isteq(path, ist("/index.html"))) {
|
|
||||||
outbuf.area[outbuf.data++] = 0x85; // indexed field : idx[04]=(":path", "/index.html")
|
|
||||||
}
|
|
||||||
else if (!hpack_encode_header(&outbuf, ist(":path"), path)) {
|
|
||||||
/* output full */
|
/* output full */
|
||||||
if (b_space_wraps(&h2c->mbuf))
|
if (b_space_wraps(&h2c->mbuf))
|
||||||
goto realign_again;
|
goto realign_again;
|
||||||
|
Loading…
Reference in New Issue
Block a user