mirror of
https://github.com/tbnobody/OpenDTU.git
synced 2026-01-06 04:44:50 +01:00
Fix: Dont allow HA base topic without trailing slash
This commit is contained in:
@@ -268,6 +268,13 @@ void WebApiMqttClass::onMqttAdminPost(AsyncWebServerRequest* request)
|
||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!root["mqtt_hass_topic"].as<String>().endsWith("/")) {
|
||||
retMsg["message"] = "Hass topic must end with a slash (/)!";
|
||||
retMsg["code"] = WebApiError::MqttHassTopicTrailingSlash;
|
||||
WebApi.sendJsonResponse(request, response, __FUNCTION__, __LINE__);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user