Skip to content

Problem with registering complex paths #125

@ikorman

Description

@ikorman

Platform

ESP32

IDE / Tooling

PlatformIO

What happened?

For some reason I have issue when registering pages that have complex paths, like for example "/config/ResetConfig" where handleResetConfig never gets triggered. Here is sample code for registration:

` server.on("/config", HTTP_GET, [this](AsyncWebServerRequest *request)
{ this->handleConfig(request); });

server.on("/config", HTTP_POST, [this](AsyncWebServerRequest *request)
          { this->handleConfig(request); });

server.on("/config/ResetConfig", HTTP_GET, [this](AsyncWebServerRequest *request)
          { this->handleResetConfig(request); });

server.on("/configResetDevice", HTTP_GET, [this](AsyncWebServerRequest *request)`

In above example, when I direct my browser to "/config/ResetConfig" nothing happens, but when rename path in the code to "/configResetConfig" handler is called when accessing "/configResetConfig". What is causing this?

Stack Trace

n/a

Minimal Reproductible Example (MRE)

` server.on("/config", HTTP_GET, [this](AsyncWebServerRequest *request)
{ this->handleConfig(request); });

server.on("/config", HTTP_POST, [this](AsyncWebServerRequest *request)
          { this->handleConfig(request); });

server.on("/config/ResetConfig", HTTP_GET, [this](AsyncWebServerRequest *request)
          { this->handleResetConfig(request); });

server.on("/configResetDevice", HTTP_GET, [this](AsyncWebServerRequest *request)`

I confirm that:

  • I have read the documentation.
  • I have searched for similar discussions.
  • I have searched for similar issues.
  • I have looked at the examples.
  • I have upgraded to the lasted version of ESPAsyncWebServer (and AsyncTCP for ESP32).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions