Skip to content

Commit

Permalink
Updated libjuice to v1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
paullouisageneau committed Jun 13, 2024
1 parent a8bf0f9 commit d624c82
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion deps/libjuice
Submodule libjuice updated 1 files
+1 −8 CMakeLists.txt
22 changes: 13 additions & 9 deletions src/impl/wshandshake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ string WsHandshake::generateHttpRequest() {
"Host: " +
mHost +
"\r\n"
"Connection: upgrade\r\n"
"Connection: Upgrade\r\n"
"Upgrade: websocket\r\n"
"Sec-WebSocket-Version: 13\r\n"
"Sec-WebSocket-Key: " +
Expand All @@ -80,12 +80,18 @@ string WsHandshake::generateHttpRequest() {

string WsHandshake::generateHttpResponse() {
std::unique_lock lock(mMutex);
const string out = "HTTP/1.1 101 Switching Protocols\r\n"
"Server: libdatachannel\r\n"
"Connection: upgrade\r\n"
"Upgrade: websocket\r\n"
"Sec-WebSocket-Accept: " +
computeAcceptKey(mKey) + "\r\n\r\n";

string out = "HTTP/1.1 101 Switching Protocols\r\n"
"Server: libdatachannel\r\n"
"Connection: Upgrade\r\n"
"Upgrade: websocket\r\n"
"Sec-WebSocket-Accept: " +
computeAcceptKey(mKey) + "\r\n";

if (!mProtocols.empty())
out += "Sec-WebSocket-Protocol: " + utils::implode(mProtocols, ',') + "\r\n";

out += "\r\n";

return out;
}
Expand Down Expand Up @@ -119,8 +125,6 @@ string WsHandshake::generateHttpError(int responseCode) {
const string out = "HTTP/1.1 " + error +
"\r\n"
"Server: libdatachannel\r\n"
"Connection: upgrade\r\n"
"Upgrade: websocket\r\n"
"Content-Type: text/plain\r\n"
"Content-Length: " +
to_string(error.size()) +
Expand Down

0 comments on commit d624c82

Please sign in to comment.