[GH-ISSUE #1650] How to disable update and info pages? #1404

Closed
opened 2026-02-28 01:29:56 +03:00 by kerem · 5 comments
Owner

Originally created by @georgevbsantiago on GitHub (Aug 29, 2023).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1650

Hello,

I limited the display of the menus with the method:

const char* menu[] = {"wifi","param","sep","exit"};
wifiManager.setMenu(menu, 4);

However, when we typed "192.168.4.1/update" and "192.168.4.1/info", we were able to access the HTML pages.

Is there a way to disable the "update" and "info" pages so that the user cannot access them through the browser?

Originally created by @georgevbsantiago on GitHub (Aug 29, 2023). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1650 Hello, I limited the display of the menus with the method: ``` const char* menu[] = {"wifi","param","sep","exit"}; wifiManager.setMenu(menu, 4); ``` However, when we typed "192.168.4.1/update" and "192.168.4.1/info", we were able to access the HTML pages. Is there a way to disable the "update" and "info" pages so that the user cannot access them through the browser?
kerem 2026-02-28 01:29:56 +03:00
Author
Owner

@georgevbsantiago commented on GitHub (Aug 29, 2023):

In 'wm_consts_en.h', I changed the values to "". Apparently it worked. But I don't know if this is correct or can cause bugs.

const char R_info[]               PROGMEM = "";
const char R_update[]             PROGMEM = "";
<!-- gh-comment-id:1697579044 --> @georgevbsantiago commented on GitHub (Aug 29, 2023): In 'wm_consts_en.h', I changed the values to "". Apparently it worked. But I don't know if this is correct or can cause bugs. ``` const char R_info[] PROGMEM = ""; const char R_update[] PROGMEM = ""; ```
Author
Owner

@tablatronix commented on GitHub (Sep 8, 2023):

That works, you can also add overrides to those routes in user code

<!-- gh-comment-id:1711981249 --> @tablatronix commented on GitHub (Sep 8, 2023): That works, you can also add overrides to those routes in user code
Author
Owner

@tablatronix commented on GitHub (Sep 8, 2023):

}

void bindServerCallback(){
  wm.server->on("/custom",handleRoute);

  // you can override wm route endpoints
  wm.server->on("/info",handleNotFound);
  wm.server->on("/update",handleNotFound);
  wm.server->on("/erase",handleNotFound);
}

I am not sure there is a way to remove webserver handlers, maybe an empty lambda, but I had crashes with my preliminary tests.

I hope to add these features as build options but for now ust use your own handler for these, I will probably also make wm.handleNotFound public

So removing the menu and options to remove buttons and overriding the routes. You could also add your own auth here also in user code.

<!-- gh-comment-id:1712053557 --> @tablatronix commented on GitHub (Sep 8, 2023): ``` } void bindServerCallback(){ wm.server->on("/custom",handleRoute); // you can override wm route endpoints wm.server->on("/info",handleNotFound); wm.server->on("/update",handleNotFound); wm.server->on("/erase",handleNotFound); } ``` I am not sure there is a way to remove webserver handlers, maybe an empty lambda, but I had crashes with my preliminary tests. I hope to add these features as build options but for now ust use your own handler for these, I will probably also make wm.handleNotFound public So removing the menu and options to remove buttons and overriding the routes. You could also add your own auth here also in user code.
Author
Owner

@tablatronix commented on GitHub (Sep 8, 2023):

eb27c525e3

<!-- gh-comment-id:1712069671 --> @tablatronix commented on GitHub (Sep 8, 2023): eb27c525e33e6ce558bd27496685ec657f2cb23e
Author
Owner

@tablatronix commented on GitHub (Sep 8, 2023):

#982

<!-- gh-comment-id:1712081978 --> @tablatronix commented on GitHub (Sep 8, 2023): #982
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1404
No description provided.