add file support

This commit is contained in:
Антон 2024-03-26 20:36:34 +03:00
parent 7ab65a520f
commit 37a7202376
2 changed files with 2 additions and 0 deletions

0
public/favicon.ico Normal file
View File

View File

@ -25,9 +25,11 @@ FileResponse GetStaticAssetHandler(const StringRequest& req)
if (sys::error_code ec; file.open(abs_path.string().c_str(), beast::file_mode::read, ec), ec)
{
res.result(http::status::not_found);
res.set(http::field::content_type, content_type::k_TextPlain);
}
else
{
res.result(http::status::ok);
res.body() = std::move(file);
res.prepare_payload();
}