@@ -112,15 +112,17 @@ size_t AsyncMessagePackResponse::_fillBuffer(uint8_t *data, size_t len) {
112112#endif
113113
114114// Body handler supporting both content types: JSON and MessagePack
115- constexpr static bool JsonHandlerMethods =
116- AsyncWebRequestMethod::HTTP_GET | AsyncWebRequestMethod::HTTP_POST | AsyncWebRequestMethod::HTTP_PUT | AsyncWebRequestMethod::HTTP_PATCH;
117115
118116#if ARDUINOJSON_VERSION_MAJOR == 6
119117AsyncCallbackJsonWebHandler::AsyncCallbackJsonWebHandler (AsyncURIMatcher uri, ArJsonRequestHandlerFunction onRequest, size_t maxJsonBufferSize)
120- : _uri(std::move(uri)), _method(JsonHandlerTypes), _onRequest(onRequest), maxJsonBufferSize(maxJsonBufferSize), _maxContentLength(16384 ) {}
118+ : _uri(std::move(uri)),
119+ _method(AsyncWebRequestMethod::HTTP_GET | AsyncWebRequestMethod::HTTP_POST | AsyncWebRequestMethod::HTTP_PUT | AsyncWebRequestMethod::HTTP_PATCH),
120+ _onRequest(onRequest), maxJsonBufferSize(maxJsonBufferSize), _maxContentLength(16384 ) {}
121121#else
122122AsyncCallbackJsonWebHandler::AsyncCallbackJsonWebHandler (AsyncURIMatcher uri, ArJsonRequestHandlerFunction onRequest)
123- : _uri(std::move(uri)), _method(JsonHandlerMethods), _onRequest(onRequest), _maxContentLength(16384 ) {}
123+ : _uri(std::move(uri)),
124+ _method(AsyncWebRequestMethod::HTTP_GET | AsyncWebRequestMethod::HTTP_POST | AsyncWebRequestMethod::HTTP_PUT | AsyncWebRequestMethod::HTTP_PATCH),
125+ _onRequest(onRequest), _maxContentLength(16384 ) {}
124126#endif
125127
126128bool AsyncCallbackJsonWebHandler::canHandle (AsyncWebServerRequest *request) const {
0 commit comments