Fix payload iteration issue of FormBody; Log form body; ignore body for response of HEAD.

This commit is contained in:
Chunting Gu
2019-07-09 13:18:55 +08:00
parent 3309e7896a
commit b2cbc450b8
21 changed files with 364 additions and 165 deletions
+14
View File
@@ -3,6 +3,8 @@
#include <string>
#include "webcc/globals.h"
namespace webcc {
namespace utility {
@@ -22,6 +24,18 @@ std::string GetTimestamp();
bool SplitKV(const std::string& str, char delimiter,
std::string* key, std::string* value);
// Tell the size in bytes of the given file.
// Return kInvalidLength (-1) on failure.
std::size_t TellSize(const Path& path);
// Read entire file into string.
bool ReadFile(const Path& path, std::string* output);
// Dump the string data line by line to achieve more readability.
// Also limit the maximum size of the data to be dumped.
void DumpByLine(const std::string& data, std::ostream& os,
const std::string& prefix);
} // namespace utility
} // namespace webcc