diff options
| author | Stefan Boberg <[email protected]> | 2025-03-04 09:38:13 +0100 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2025-03-04 09:38:13 +0100 |
| commit | 2232eb28256ec54beaf3dbe06f5176698c7245a0 (patch) | |
| tree | de7ae8468a0b4b79003b0c0f1fcbab72abdc36d6 /src/zencore/include | |
| parent | refactor use chunk sequence download (#291) (diff) | |
| download | zen-2232eb28256ec54beaf3dbe06f5176698c7245a0.tar.xz zen-2232eb28256ec54beaf3dbe06f5176698c7245a0.zip | |
limit and validate responses before logging the text (#292)
Improvement: When logging HTTP responses, the body is now sanity checked to ensure it is human readable, and the length of the output is capped to prevent inadvertent log bloat
Diffstat (limited to 'src/zencore/include')
| -rw-r--r-- | src/zencore/include/zencore/string.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/zencore/include/zencore/string.h b/src/zencore/include/zencore/string.h index e2ef1c1a0..68129b691 100644 --- a/src/zencore/include/zencore/string.h +++ b/src/zencore/include/zencore/string.h @@ -522,6 +522,9 @@ public: ////////////////////////////////////////////////////////////////////////// +bool IsValidUtf8(const std::string_view& str); +std::string_view::const_iterator FindFirstInvalidUtf8Byte(const std::string_view& str); + void Utf8ToWide(const char8_t* str, WideStringBuilderBase& out); void Utf8ToWide(const std::u8string_view& wstr, WideStringBuilderBase& out); void Utf8ToWide(const std::string_view& wstr, WideStringBuilderBase& out); |