SVNからのミラー

This commit is contained in:
2026-01-21 04:06:54 +09:00
commit fe74b223ce
35 changed files with 14669 additions and 0 deletions

25
crow/middlewares/utf-8.h Normal file
View File

@@ -0,0 +1,25 @@
#pragma once
#include "crow/http_request.h"
#include "crow/http_response.h"
namespace crow
{
struct UTF8
{
struct context
{};
void before_handle(request& /*req*/, response& /*res*/, context& /*ctx*/)
{}
void after_handle(request& /*req*/, response& res, context& /*ctx*/)
{
if (get_header_value(res.headers, "Content-Type").empty())
{
res.set_header("Content-Type", "text/plain; charset=utf-8");
}
}
};
} // namespace crow