Skip to content

DELETE /yoyo/credentials is entirely non-functional #69

Description

@davidchatting-bot

Where

Two related sites in `src/YoYoWiFiManager.cpp`:

`onYoYoRequestDELETE()` - the whole implementation is commented out, and it always returns 500:
```cpp
int YoYoWiFiManager::onYoYoRequestDELETE(uint8_t *data, size_t len, AsyncWebServerRequest *request) {
//TODO fix this!
...(all commented out)...
return(500);
}
```

`onYoYoMessageDELETE()` - even if the above were fixed and this got called, it doesn't actually do anything:
```cpp
if (message["path"] == "/yoyo/credentials") {
//TODO: implement delete using YoYoSettings::removeNetwork()
success = true;
}
```

Problem

So today, two independent bugs stack to make DELETE completely non-functional: the request never reaches `onYoYoMessageDELETE()` at all (every DELETE to any `/yoyo/*` path gets a 500), and even the handler for the one implemented path (`/yoyo/credentials`) just claims success without calling `YoYoSettings::removeNetwork()` - i.e. it's a no-op that lies about succeeding.

Ask

  • Re-enable/fix `onYoYoRequestDELETE()`'s JSON body parsing (mirroring the pattern already used in `onYoYoRequestPOST()`, including the bounded-copy fix from Off-by-one buffer overflow parsing POST body in onYoYoRequestPOST() #57).
  • Wire `onYoYoMessageDELETE()`'s `/yoyo/credentials` case up to `YoYoSettings::removeNetwork(ssid)`, which already exists and is otherwise unused from any endpoint.

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