Never return more than maxPayloadLength in PMD mock
This commit is contained in:
@@ -58,7 +58,7 @@ namespace uWS {
|
|||||||
struct ZlibContext {};
|
struct ZlibContext {};
|
||||||
struct InflationStream {
|
struct InflationStream {
|
||||||
std::optional<std::string_view> inflate(ZlibContext *zlibContext, std::string_view compressed, size_t maxPayloadLength) {
|
std::optional<std::string_view> inflate(ZlibContext *zlibContext, std::string_view compressed, size_t maxPayloadLength) {
|
||||||
return compressed;
|
return compressed.substr(0, std::min(maxPayloadLength, compressed.length()));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
struct DeflationStream {
|
struct DeflationStream {
|
||||||
|
|||||||
Reference in New Issue
Block a user