diff options
author | Alexey Efimov <xeno@prnwatch.com> | 2022-02-10 16:49:41 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:41 +0300 |
commit | 26e0e4fb5e5cd6b4d7f4c21f9fcd7978891bf946 (patch) | |
tree | d34555f21d4d9f94f84d460e55b77d7eb41a953c /library/cpp/http/io/stream.cpp | |
parent | ca3252a147a429eac4ba8221857493c58dcd09b5 (diff) | |
download | ydb-26e0e4fb5e5cd6b4d7f4c21f9fcd7978891bf946.tar.gz |
Restoring authorship annotation for Alexey Efimov <xeno@prnwatch.com>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/http/io/stream.cpp')
-rw-r--r-- | library/cpp/http/io/stream.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/library/cpp/http/io/stream.cpp b/library/cpp/http/io/stream.cpp index 6689be684f..115bc9b066 100644 --- a/library/cpp/http/io/stream.cpp +++ b/library/cpp/http/io/stream.cpp @@ -640,15 +640,15 @@ private: return IsRequest(FirstLine_); } - inline bool HasResponseBody() const noexcept { - if (IsHttpResponse()) { + inline bool HasResponseBody() const noexcept { + if (IsHttpResponse()) { if (Request_ && Request_->FirstLine().StartsWith(TStringBuf("HEAD"))) - return false; + return false; if (FirstLine_.size() > 9 && strncmp(FirstLine_.data() + 9, "204", 3) == 0) - return false; - return true; - } - return false; + return false; + return true; + } + return false; } inline bool IsHttpResponse() const noexcept { @@ -772,7 +772,7 @@ private: } if (IsHttpResponse()) { - if (Request_ && IsCompressionEnabled() && HasResponseBody()) { + if (Request_ && IsCompressionEnabled() && HasResponseBody()) { TString scheme = Request_->BestCompressionScheme(ComprSchemas_); if (scheme != "identity") { AddOrReplaceHeader(THttpInputHeader("Content-Encoding", scheme)); @@ -826,7 +826,7 @@ private: } } - if (!haveContentLength && !chunked && (IsHttpRequest() || HasResponseBody()) && SupportChunkedTransfer() && (keepAlive || encoder || IsHttpRequest())) { + if (!haveContentLength && !chunked && (IsHttpRequest() || HasResponseBody()) && SupportChunkedTransfer() && (keepAlive || encoder || IsHttpRequest())) { AddHeader(THttpInputHeader("Transfer-Encoding", "chunked")); chunked = true; } |