This commit is contained in:
Nicholas Orlowsky 2023-10-17 13:33:22 -04:00
parent d6eb46d310
commit ac669ba504
No known key found for this signature in database
GPG key ID: BE7DF0188A405E2B
3 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,8 @@
# 0.1.2 Fourth Pre-Release
- Fixed bug with mapping / to index.html
- Addex Origin-Server header
# 0.1.1 Third Pre-Release
- Add mappings for common MIME types

View file

@ -7,7 +7,7 @@ private:
string file_dir;
unique_ptr<http_response> handle_request_cache(http_request& req) {
string filename = req.path() == "/" ? "index.html" : req.path();
string filename = req.path() == "/" ? "/index.html" : req.path();
filename = file_dir + filename;
auto file_info = file_cache.find(filename);

View file

@ -438,6 +438,7 @@ public:
add_header(http_header("Content-Type", content_type), false);
add_header(http_header("Content-Length", ::to_string(_content.length())), false);
add_header(http_header("Server", "Anthracite/0.0.1"), false);
add_header(http_header("Origin-Server", "Anthracite/0.0.1"), false);
for (auto header : _headers) {
response += header.second.to_string();