diff options
| author | vvminashkin <[email protected]> | 2025-09-01 13:19:45 +0300 |
|---|---|---|
| committer | vvminashkin <[email protected]> | 2025-09-01 13:37:50 +0300 |
| commit | d5c732f136c153c49ae5c22be4d767a05a2ace6e (patch) | |
| tree | 333b98f28995889c3d838948199e2991a773159f /library/cpp/monlib/encode/format.cpp | |
| parent | 423ef10e91de827a44cf8f2b36146bddd0c97549 (diff) | |
[fetcher] use lz4 encoding
[fetcher] use lz4 encoding
commit_hash:e29504c1f68be2a5d138dbba0ed461b2f2568b97
Diffstat (limited to 'library/cpp/monlib/encode/format.cpp')
| -rw-r--r-- | library/cpp/monlib/encode/format.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/library/cpp/monlib/encode/format.cpp b/library/cpp/monlib/encode/format.cpp index 63f9932aad2..dbcc2411f46 100644 --- a/library/cpp/monlib/encode/format.cpp +++ b/library/cpp/monlib/encode/format.cpp @@ -97,6 +97,21 @@ namespace NMonitoring { return CompressionFromHeader(value); } + ECompression FastestCompressionFromAcceptEncodingHeader(TStringBuf value) { + if (value.empty()) { + return ECompression::UNKNOWN; + } + + for (const auto& it : StringSplitter(value).Split(',').SkipEmpty()) { + TStringBuf token = StripString(it.Token()); + if (AsciiEqualsIgnoreCase(token, NFormatContentEncoding::LZ4)) { + return ECompression::LZ4; + } + } + + return CompressionFromAcceptEncodingHeader(value); + } + TStringBuf ContentEncodingByCompression(ECompression compression) { switch (compression) { case ECompression::IDENTITY: |
