From 1d8e32ec74deea3addbc71011ce915f9eb34e050 Mon Sep 17 00:00:00 2001 From: proddy Date: Mon, 4 Nov 2024 11:59:18 +0100 Subject: [PATCH] use msgpack content-type - #2166 --- lib/ESPAsyncWebServer/src/AsyncJson.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ESPAsyncWebServer/src/AsyncJson.h b/lib/ESPAsyncWebServer/src/AsyncJson.h index 4c12df572..0cb74acf3 100644 --- a/lib/ESPAsyncWebServer/src/AsyncJson.h +++ b/lib/ESPAsyncWebServer/src/AsyncJson.h @@ -7,7 +7,8 @@ #include #include -constexpr const char * JSON_MIMETYPE = "application/json"; +constexpr const char * JSON_MIMETYPE = "application/json"; +constexpr const char * MSGPACK_MIMETYPE = "application/msgpack"; class ChunkPrint : public Print { private: @@ -54,7 +55,7 @@ class AsyncJsonResponse : public AsyncAbstractResponse { : _isValid{false} , _isMsgPack{isMsgPack} { _code = 200; - _contentType = JSON_MIMETYPE; + _contentType = (isMsgPack) ? MSGPACK_MIMETYPE : JSON_MIMETYPE; if (isArray) _root = _jsonBuffer.add(); else