-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathurl_not_found_log.patch
30 lines (28 loc) · 2.01 KB
/
url_not_found_log.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- ./.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src/WebServer.org 2024-12-13 19:10:23.948170121 -0500
+++ ./.platformio/packages/framework-arduinoespressif32/libraries/WebServer/src/WebServer.cpp 2024-12-13 19:20:29.965364972 -0500
@@ -44,14 +44,14 @@
WebServer::WebServer(IPAddress addr, int port)
: _corsEnabled(false), _server(addr, port), _currentMethod(HTTP_ANY), _currentVersion(0), _currentStatus(HC_NONE), _statusChange(0), _nullDelay(true),
- _currentHandler(nullptr), _firstHandler(nullptr), _lastHandler(nullptr), _currentArgCount(0), _currentArgs(nullptr), _postArgsLen(0), _postArgs(nullptr),
+ _currentHandler(nullptr), _firstHandler(nullptr), _lastHandler(nullptr), _notFoundHandler(nullptr), _currentArgCount(0), _currentArgs(nullptr), _postArgsLen(0), _postArgs(nullptr),
_headerKeysCount(0), _currentHeaders(nullptr), _contentLength(0), _clientContentLength(0), _chunked(false) {
log_v("WebServer::Webserver(addr=%s, port=%d)", addr.toString().c_str(), port);
}
WebServer::WebServer(int port)
: _corsEnabled(false), _server(port), _currentMethod(HTTP_ANY), _currentVersion(0), _currentStatus(HC_NONE), _statusChange(0), _nullDelay(true),
- _currentHandler(nullptr), _firstHandler(nullptr), _lastHandler(nullptr), _currentArgCount(0), _currentArgs(nullptr), _postArgsLen(0), _postArgs(nullptr),
+ _currentHandler(nullptr), _firstHandler(nullptr), _lastHandler(nullptr), _notFoundHandler(nullptr), _currentArgCount(0), _currentArgs(nullptr), _postArgsLen(0), _postArgs(nullptr),
_headerKeysCount(0), _currentHeaders(nullptr), _contentLength(0), _clientContentLength(0), _chunked(false) {
log_v("WebServer::Webserver(port=%d)", port);
}
@@ -791,7 +791,9 @@
void WebServer::_handleRequest() {
bool handled = false;
if (!_currentHandler) {
- log_e("request handler not found");
+ if (!_notFoundHandler) {
+ log_e("request handler not found");
+ }
} else {
handled = _currentHandler->handle(*this, _currentMethod, _currentUri);
if (!handled) {