From 953c680eee5fedb928b6140d5eb1d534da5c4df5 Mon Sep 17 00:00:00 2001 From: Francisco Javier Date: Sat, 25 Apr 2020 20:39:37 +0200 Subject: [PATCH] Bug on setting extra headers. Now it loses the first string character. (#184) Client code: ... ix::WebSocketHttpHeaders headers { {"Cookie", "ABC"} }; ... Expected header string on server: "Cookie: ABC" Resulted header string on server: "Cookie: BC" Solution: The easy way I found to solve the problem is to add a space where extra headers are set before sended to server. Co-authored-by: Fco. Javier M. C --- ixwebsocket/IXWebSocketHandshake.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ixwebsocket/IXWebSocketHandshake.cpp b/ixwebsocket/IXWebSocketHandshake.cpp index 9554be4a..2c972c80 100644 --- a/ixwebsocket/IXWebSocketHandshake.cpp +++ b/ixwebsocket/IXWebSocketHandshake.cpp @@ -133,7 +133,7 @@ namespace ix for (auto& it : extraHeaders) { - ss << it.first << ":" << it.second << "\r\n"; + ss << it.first << ": " << it.second << "\r\n"; } if (_enablePerMessageDeflate)