update deps

This commit is contained in:
2026-02-22 13:20:41 +01:00
parent ce20ca6b35
commit ea90f8bc7f
3 changed files with 6 additions and 15 deletions

View File

@@ -18,7 +18,9 @@ int main() {
cors.global()
.headers("Content-Type", "Authorization")
.methods("GET"_method, "POST"_method, "PUT"_method, "DELETE"_method, "OPTIONS"_method)
.origin(settings.domain);
.allow_credentials()
.origin(settings.domain)
.max_age(86400);
// create global database
dbpool = std::make_unique<DatabasePool>(settings.db_path);
@@ -39,17 +41,6 @@ int main() {
return 1;
}
// options path
CROW_ROUTE(app, "/<path>") .methods("OPTIONS"_method)
([&settings](const crow::request&, crow::response& res, const std::string&) {
res.add_header("Access-Control-Allow-Origin", settings.domain);
res.add_header("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS");
res.add_header("Access-Control-Allow-Headers", "Content-Type, Authorization");
res.add_header("Access-Control-Max-Age", "86400"); // Cache preflight for 24h
res.code = 204;
res.end();
});
// Root route
CROW_ROUTE(app, "/")([&]() {
return utils::getFile(utils::build_dir / "index.html");