mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-24 23:31:40 +02:00
BUG/MINOR: htx: Force HTTP/1.1 on H1 formatting when version is 1.1 or above
This only happens for connections using the h1 mux. We must be sure to force the version to HTTP/1.1 when the version of the message is 1.1 or above. It is important for H2 messages to not send an invalid version string (HTTP/2.0) to peers.
This commit is contained in:
parent
c59ff23804
commit
1e7af46aae
11
src/htx.c
11
src/htx.c
@ -814,7 +814,11 @@ int htx_reqline_to_h1(const struct htx_sl *sl, struct buffer *chk)
|
||||
chunk_memcat(chk, " ", 1);
|
||||
chunk_memcat(chk, HTX_SL_REQ_UPTR(sl), HTX_SL_REQ_ULEN(sl));
|
||||
chunk_memcat(chk, " ", 1);
|
||||
chunk_memcat(chk, HTX_SL_REQ_VPTR(sl), HTX_SL_REQ_VLEN(sl));
|
||||
if (sl->flags & HTX_SL_F_VER_11)
|
||||
chunk_memcat(chk, "HTTP/1.1", 8);
|
||||
else
|
||||
chunk_memcat(chk, HTX_SL_REQ_VPTR(sl), HTX_SL_REQ_VLEN(sl));
|
||||
|
||||
chunk_memcat(chk, "\r\n", 2);
|
||||
|
||||
return 1;
|
||||
@ -829,7 +833,10 @@ int htx_stline_to_h1(const struct htx_sl *sl, struct buffer *chk)
|
||||
if (HTX_SL_LEN(sl) + 4 > b_size(chk))
|
||||
return 0;
|
||||
|
||||
chunk_memcat(chk, HTX_SL_RES_VPTR(sl), HTX_SL_RES_VLEN(sl));
|
||||
if (sl->flags & HTX_SL_F_VER_11)
|
||||
chunk_memcat(chk, "HTTP/1.1", 8);
|
||||
else
|
||||
chunk_memcat(chk, HTX_SL_RES_VPTR(sl), HTX_SL_RES_VLEN(sl));
|
||||
chunk_memcat(chk, " ", 1);
|
||||
chunk_memcat(chk, HTX_SL_RES_CPTR(sl), HTX_SL_RES_CLEN(sl));
|
||||
chunk_memcat(chk, " ", 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user