Fix WebSocketClient dropping query string from URL during handshake (#2468)

The constructor stored only uc.path in path_, discarding uc.query, so the
WebSocket upgrade handshake sent the Request-URI without the query string.
Append the query to path_ so query parameters (e.g. auth tokens) are sent.
This commit is contained in:
yhirose committed 2026-06-07 17:08:11 -04:00
1 parent fe56a07da5
commit 79d83feb18
2 files changed
+46

No files matched your search

+1
View File
@@ -20266,6 +20266,7 @@ inline WebSocketClient::WebSocketClient(
if (!uc.port.empty() && !detail::parse_port(uc.port, port_)) { return; }
path_ = std::move(uc.path);
if (!uc.query.empty()) { path_ += uc.query; }
#ifdef CPPHTTPLIB_SSL_ENABLED
is_ssl_ = is_ssl;