Bug fixing
This commit is contained in:
@@ -59,6 +59,17 @@ bool load_config(const std::string& config_path, ServerConfig& config) {
|
||||
}
|
||||
}
|
||||
|
||||
// Parse rate limiting configuration
|
||||
if (j.contains("rate_limiting")) {
|
||||
const auto& rate_limit = j["rate_limiting"];
|
||||
if (rate_limit.contains("auth_rate_limit")) {
|
||||
config.auth_rate_limit = rate_limit["auth_rate_limit"].get<int>();
|
||||
}
|
||||
if (rate_limit.contains("auth_window_seconds")) {
|
||||
config.auth_window_seconds = rate_limit["auth_window_seconds"].get<int>();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << "Error parsing config file: " << e.what() << std::endl;
|
||||
|
Reference in New Issue
Block a user