Skip to content

Commit 673431e

Browse files
Merge pull request #45 from ESP32Async/fix/error-500
fix(http): Status 404 should be returned by default when no notFoundHandler is set. This is not an internal server error.
2 parents 07740d1 + 3afa4bb commit 673431e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/WebHandlers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ void AsyncCallbackWebHandler::handleRequest(AsyncWebServerRequest *request) {
299299
if (_onRequest) {
300300
_onRequest(request);
301301
} else {
302-
request->send(500);
302+
request->send(404, T_text_plain, "Not found");
303303
}
304304
}
305305
void AsyncCallbackWebHandler::handleUpload(AsyncWebServerRequest *request, const String &filename, size_t index, uint8_t *data, size_t len, bool final) {

0 commit comments

Comments
 (0)