wpiutil: WebSocket: Fix Sec-Websocket-Accept computation

It needs to use the raw SHA1 bytes, not the hex-decoded text.
This commit is contained in:
Peter Johnson
2018-11-18 18:27:06 -08:00
parent 75cc3cda28
commit e4aa45f34b
3 changed files with 4 additions and 3 deletions

View File

@@ -40,7 +40,7 @@ class WebSocketClientTest : public WebSocketTest {
SmallString<64> hashBuf;
SmallString<64> acceptBuf;
os << "Sec-WebSocket-Accept: "
<< Base64Encode(hash.Final(hashBuf), acceptBuf) << "\r\n";
<< Base64Encode(hash.RawFinal(hashBuf), acceptBuf) << "\r\n";
if (!mockProtocol.empty())
os << "Sec-WebSocket-Protocol: " << mockProtocol << "\r\n";