Skip to content

Commit c545db2

Browse files
committed
removed config endpoint
1 parent 307f7d1 commit c545db2

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

slscore/SLSApiServer.cpp

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -172,11 +172,6 @@ void CSLSApiServer::setupEndpoints() {
172172
handleStats(req, res);
173173
});
174174

175-
// Configuration endpoint
176-
m_server.Get("/api/config", [this](const httplib::Request& req, httplib::Response& res) {
177-
handleConfig(req, res);
178-
});
179-
180175
// API key management endpoint
181176
m_server.Post("/api/keys", [this](const httplib::Request& req, httplib::Response& res) {
182177
handleApiKeys(req, res);
@@ -381,44 +376,6 @@ void CSLSApiServer::handleStats(const httplib::Request& req, httplib::Response&
381376
res.set_content(ret.dump(), "application/json");
382377
}
383378

384-
void CSLSApiServer::handleConfig(const httplib::Request& req, httplib::Response& res) {
385-
setCorsHeaders(res);
386-
387-
// Rate limiting
388-
if (!checkRateLimit(req.remote_addr, "config")) {
389-
res.status = 429;
390-
json error;
391-
error["status"] = "error";
392-
error["message"] = "Rate limit exceeded";
393-
res.set_content(error.dump(), "application/json");
394-
return;
395-
}
396-
397-
// Authentication
398-
std::string permissions;
399-
if (!authenticateRequest(req, res, permissions)) {
400-
return;
401-
}
402-
403-
json response;
404-
response["status"] = "success";
405-
json config;
406-
407-
// Get configuration from conf structure
408-
config["listen_publisher"] = 4001; // These are hardcoded as defaults in server conf
409-
config["listen_player"] = 4000;
410-
config["http_port"] = m_conf ? m_conf->http_port : 8080;
411-
412-
config["latency_min"] = 200; // default minimum latency
413-
config["latency_max"] = 5000; // default maximum latency
414-
415-
response["data"] = config;
416-
417-
res.set_content(response.dump(), "application/json");
418-
CSLSDatabase::getInstance().logAccess(req.get_header_value("Authorization").substr(7),
419-
req.path, req.method, req.remote_addr, 200);
420-
}
421-
422379
void CSLSApiServer::handleApiKeys(const httplib::Request& req, httplib::Response& res) {
423380
setCorsHeaders(res);
424381

0 commit comments

Comments
 (0)