'Generic Commit'
Some checks failed
Build-Test-Publish / Build (push) Failing after 1m47s

This commit is contained in:
Your Name
2025-06-02 00:27:48 +12:00
parent 4259f6d960
commit d8e15f3f19
6 changed files with 141 additions and 0 deletions

View File

@@ -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;