This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "compress.hpp"
|
||||
#include "string_utils.hpp" // Include the new utility header
|
||||
#include "put_handler.hpp"
|
||||
#include "update_handler.hpp" // Include the new update handler header
|
||||
#include "utils.hpp"
|
||||
#include "welcome_page.hpp"
|
||||
|
||||
@@ -106,6 +107,9 @@ Server::Server(const ServerConfig& config)
|
||||
// Initialize the put handler
|
||||
put_handler_ = std::make_unique<PutHandler>(*this);
|
||||
|
||||
// Initialize the update handler
|
||||
update_handler_ = std::make_unique<UpdateHandler>(*this);
|
||||
|
||||
// Initialize rate limiter
|
||||
auth_rate_limiter_ = std::make_unique<RateLimiter>(
|
||||
config_.auth_rate_limit,
|
||||
@@ -183,6 +187,11 @@ void Server::setup_routes() {
|
||||
put_handler_->handle_put_object(req, res);
|
||||
});
|
||||
|
||||
// Update object metadata (new endpoint)
|
||||
server_.Put("/update", [this](const httplib::Request& req, httplib::Response& res) {
|
||||
update_handler_->handle_update_object(req, res);
|
||||
});
|
||||
|
||||
// Handle PUT requests to other paths
|
||||
server_.Put("/(.*)", [this](const httplib::Request& req, httplib::Response& res) {
|
||||
res.status = 404;
|
||||
|
Reference in New Issue
Block a user