изменил политику кеширования, убрал строковые константы из статистик (пилоты, размер кадра)
This commit is contained in:
@@ -43,6 +43,7 @@ void http::resource::StaticFileFactory::registerFile(const std::string &path, se
|
||||
void http::resource::StaticFileFactory::serve(const std::string &path, server::Reply &rep) {
|
||||
for (auto& f: this->files) {
|
||||
if (f.path == path) {
|
||||
#ifdef USE_DEBUG
|
||||
if (f.allowCache) {
|
||||
rep.content.clear();
|
||||
rep.content.insert(rep.content.end(), f.content.begin(), f.content.end());
|
||||
@@ -50,6 +51,10 @@ void http::resource::StaticFileFactory::serve(const std::string &path, server::R
|
||||
BOOST_LOG_TRIVIAL(debug) << "Reload file " << path << " (http path: " << path << ")";
|
||||
loadFile(f.path, rep.content);
|
||||
}
|
||||
#else
|
||||
rep.content.clear();
|
||||
rep.content.insert(rep.content.end(), f.content.begin(), f.content.end());
|
||||
#endif
|
||||
rep.status = server::ok;
|
||||
// rep.headers.clear();
|
||||
rep.headers.push_back({.name = "Content-Type", .value = server::mime_types::toString(f.type)});
|
||||
|
Reference in New Issue
Block a user