@@ -147,7 +147,12 @@ class WebServer {
147147 void on (const Uri &uri, THandlerFunction fn);
148148 void on (const Uri &uri, HTTPMethod method, THandlerFunction fn);
149149 void on (const Uri &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn); // ufn handles file uploads
150+ bool removeRoute (const char *uri);
151+ bool removeRoute (const char *uri, HTTPMethod method);
152+ bool removeRoute (const String &uri);
153+ bool removeRoute (const String &uri, HTTPMethod method);
150154 void addHandler (RequestHandler *handler);
155+ bool removeHandler (RequestHandler *handler);
151156 void serveStatic (const char *uri, fs::FS &fs, const char *path, const char *cache_header = NULL );
152157 void onNotFound (THandlerFunction fn); // called when handler is not assigned
153158 void onFileUpload (THandlerFunction ufn); // handle file uploads
@@ -230,6 +235,7 @@ class WebServer {
230235 return _currentClient.write_P (b, l);
231236 }
232237 void _addRequestHandler (RequestHandler *handler);
238+ bool _removeRequestHandler (RequestHandler *handler);
233239 void _handleRequest ();
234240 void _finalizeResponse ();
235241 bool _parseRequest (NetworkClient &client);
0 commit comments