Return empty object with code as specified in the API when calling PUT/DELETE /api/config/...

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER 2023-10-26 00:07:45 +02:00
parent 8664165ebc
commit abf0b735a4
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD
1 changed files with 4 additions and 1 deletions

View File

@ -925,7 +925,10 @@ static int api_config_put_delete(struct ftl_conn *api)
// Store changed configuration to disk
writeFTLtoml(true);
return api->method == HTTP_PUT ? 201 : 204; // 201 - Created or 204 - No content
// Send empty reply with matching HTTP status code
// 201 - Created or 204 - No content
cJSON *json = JSON_NEW_OBJECT();
JSON_SEND_OBJECT_CODE(json, api->method == HTTP_PUT ? 201 : 204);
}
// Endpoint /api/config router