mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
h2: client: do not apply host header if h2 negotiated by alpn
If client negotiated over alpn, it will have done SNI. Some peers like youtube.com reject with 400 if you sent a host: as well.
This commit is contained in:
parent
70ba29d568
commit
8021ab54f0
2 changed files with 4 additions and 2 deletions
|
@ -327,7 +327,7 @@ set(PACKAGE "libwebsockets")
|
|||
set(CPACK_PACKAGE_NAME "${PACKAGE}")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "4")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "0")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "6")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "7")
|
||||
set(CPACK_PACKAGE_RELEASE 1)
|
||||
set(CPACK_GENERATOR "RPM")
|
||||
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
|
||||
|
|
|
@ -1414,6 +1414,7 @@ lws_h2_parse_end_of_frame(struct lws *wsi)
|
|||
/* pass on the initial headers to SID 1 */
|
||||
h2n->swsi->http.ah = wsi->http.ah;
|
||||
h2n->swsi->client_mux_substream = 1;
|
||||
h2n->swsi->client_h2_alpn = 1;
|
||||
#if defined(LWS_WITH_CLIENT)
|
||||
h2n->swsi->flags = wsi->flags;
|
||||
#endif
|
||||
|
@ -2381,7 +2382,8 @@ lws_h2_client_handshake(struct lws *wsi)
|
|||
&p, end))
|
||||
goto fail_length;
|
||||
|
||||
if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HOST,
|
||||
if (!wsi->client_h2_alpn &&
|
||||
lws_add_http_header_by_token(wsi, WSI_TOKEN_HOST,
|
||||
(unsigned char *)lws_hdr_simple_ptr(wsi,
|
||||
_WSI_TOKEN_CLIENT_HOST),
|
||||
lws_hdr_total_length(wsi, _WSI_TOKEN_CLIENT_HOST),
|
||||
|
|
Loading…
Add table
Reference in a new issue