Checkpoint
This commit is contained in:
@@ -21,6 +21,8 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
#include "ss.hpp"
|
||||
#include <map>
|
||||
|
||||
using namespace pipedal;
|
||||
|
||||
@@ -388,3 +390,21 @@ std::string HtmlHelper::generateEtag(const std::filesystem::path &path)
|
||||
crc = crc64((uint8_t*)&fTime, sizeof(fTime));
|
||||
return std::to_string(crc);
|
||||
}
|
||||
|
||||
static std::map<int,std::string> httpErrorStrings =
|
||||
{
|
||||
{200,"OK"},
|
||||
|
||||
|
||||
};
|
||||
|
||||
std::string HtmlHelper::httpErrorString(int errorCode)
|
||||
{
|
||||
auto ff = httpErrorStrings.find(errorCode);
|
||||
if (ff != httpErrorStrings.end())
|
||||
{
|
||||
return SS(errorCode << " " << ff->second);
|
||||
}
|
||||
return SS(errorCode);
|
||||
|
||||
}
|
||||
|
||||
@@ -63,6 +63,8 @@ public:
|
||||
|
||||
static std::string generateEtag(const std::filesystem::path &path);
|
||||
|
||||
static std::string httpErrorString(int errorCode);
|
||||
|
||||
};
|
||||
|
||||
} // namespace.
|
||||
Reference in New Issue
Block a user