Never return more than maxPayloadLength in PMD mock

This commit is contained in:
Alex Hultman
2021-03-01 12:46:12 +01:00
parent 5cd2d47c5d
commit ca6d4e3119
+1 -1
View File
@@ -58,7 +58,7 @@ namespace uWS {
struct ZlibContext {};
struct InflationStream {
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 {