Receiving invalid UTF-8 TEXT message should fail and close the connection (fix remaining autobahn test: 6.X UTF-8 Handling)
This commit is contained in:
parent
5d58982f77
commit
ec55b4a82a
@ -1 +1 @@
|
|||||||
5.1.6
|
5.1.7
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
## [5.1.7] - 2019-09-03
|
||||||
|
|
||||||
|
- Receiving invalid UTF-8 TEXT message should fail and close the connection (fix remaining autobahn test: 6.X UTF-8 Handling)
|
||||||
|
|
||||||
## [5.1.6] - 2019-09-03
|
## [5.1.6] - 2019-09-03
|
||||||
|
|
||||||
- Sending invalid UTF-8 TEXT message should fail and close the connection (fix remaining autobahn test: 6.X UTF-8 Handling)
|
- Sending invalid UTF-8 TEXT message should fail and close the connection (fix remaining autobahn test: 6.X UTF-8 Handling)
|
||||||
|
@ -789,13 +789,30 @@ namespace ix
|
|||||||
{
|
{
|
||||||
std::string decompressedMessage;
|
std::string decompressedMessage;
|
||||||
bool success = _perMessageDeflate.decompress(message, decompressedMessage);
|
bool success = _perMessageDeflate.decompress(message, decompressedMessage);
|
||||||
|
|
||||||
|
if (messageKind == MessageKind::MSG_TEXT && !validateUtf8(decompressedMessage))
|
||||||
|
{
|
||||||
|
close(WebSocketCloseConstants::kInvalidFramePayloadData,
|
||||||
|
WebSocketCloseConstants::kInvalidFramePayloadDataMessage);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
onMessageCallback(decompressedMessage, wireSize, !success, messageKind);
|
onMessageCallback(decompressedMessage, wireSize, !success, messageKind);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (messageKind == MessageKind::MSG_TEXT && !validateUtf8(message))
|
||||||
|
{
|
||||||
|
close(WebSocketCloseConstants::kInvalidFramePayloadData,
|
||||||
|
WebSocketCloseConstants::kInvalidFramePayloadDataMessage);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
onMessageCallback(message, wireSize, false, messageKind);
|
onMessageCallback(message, wireSize, false, messageKind);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unsigned WebSocketTransport::getRandomUnsigned()
|
unsigned WebSocketTransport::getRandomUnsigned()
|
||||||
{
|
{
|
||||||
|
@ -6,4 +6,4 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define IX_WEBSOCKET_VERSION "5.1.6"
|
#define IX_WEBSOCKET_VERSION "5.1.7"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user