diff options
author | Alexey Efimov <xeno@prnwatch.com> | 2022-02-10 16:49:42 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:49:42 +0300 |
commit | 0fd1998e1b2369f50fb694556f817d3c7fef10c8 (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/http/io/stream.cpp | |
parent | 26e0e4fb5e5cd6b4d7f4c21f9fcd7978891bf946 (diff) | |
download | ydb-0fd1998e1b2369f50fb694556f817d3c7fef10c8.tar.gz |
Restoring authorship annotation for Alexey Efimov <xeno@prnwatch.com>. Commit 2 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 115bc9b066..6689be684f 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; } |