Actually use the safer (escaped) string we construct
Also, no reason to append a null byte to it. Don't know why this worked even when not escaping "dangerous" characters. Does Webkit have a more relaxed lexical analyser? Signed-off-by: Tor Lillqvist <tml@collabora.com> Change-Id: Idfedcbf11a9ee565b954ba972e7e3bc9b804a122pull/5646/head
parent
383b6a7080
commit
410270fd14
|
@ -30,7 +30,7 @@
|
|||
|
||||
const char *user_name = "Dummy";
|
||||
|
||||
const int SHOW_JS_MAXLEN = 70;
|
||||
const int SHOW_JS_MAXLEN = 300;
|
||||
|
||||
int coolwsd_server_socket_fd = -1;
|
||||
|
||||
|
@ -87,10 +87,9 @@ static void send2JS(const std::vector<char>& buffer)
|
|||
data.push_back(ubufp[i]);
|
||||
}
|
||||
}
|
||||
data.push_back(0);
|
||||
|
||||
js = "window.TheFakeWebSocket.onmessage({'data': '";
|
||||
js = js + std::string(buffer.data(), buffer.size());
|
||||
js = js + std::string(data.data(), data.size());
|
||||
js = js + "'});";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue