Skip to content

Commit

Permalink
fix msgpack response mimetype
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Nov 4, 2024
1 parent ce9e21b commit 2d1c3c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/ESPAsyncWebServer/src/AsyncJson.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
#include <ESPAsyncWebServer.h>
#include <Print.h>

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:
Expand Down Expand Up @@ -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<JsonArray>();
else
Expand Down

0 comments on commit 2d1c3c2

Please sign in to comment.