| 762 | } |
| 763 | |
| 764 | inline void BuildOutputStream() { |
| 765 | if (CanBeKeepAlive()) { |
| 766 | AddOrReplaceHeader(THttpInputHeader("Connection", "Keep-Alive")); |
| 767 | } else { |
| 768 | AddOrReplaceHeader(THttpInputHeader("Connection", "Close")); |
| 769 | } |
| 770 | |
| 771 | if (IsHttpResponse()) { |
| 772 | if (Request_ && IsCompressionEnabled() && HasResponseBody()) { |
| 773 | TString scheme = Request_->BestCompressionScheme(ComprSchemas_); |
| 774 | if (scheme != "identity") { |
| 775 | AddOrReplaceHeader(THttpInputHeader("Content-Encoding", scheme)); |
| 776 | RemoveHeader("Content-Length"); |
| 777 | } |
| 778 | } |
| 779 | |
| 780 | RebuildStream(); |
| 781 | } else { |
| 782 | if (IsCompressionEnabled()) { |
| 783 | AddOrReplaceHeader(THttpInputHeader("Accept-Encoding", BuildAcceptEncoding())); |
| 784 | } |
| 785 | if (HasRequestBody()) { |
| 786 | RebuildStream(); |
| 787 | } |
| 788 | } |
| 789 | } |
| 790 | |
| 791 | inline TString BuildAcceptEncoding() const { |
| 792 | TString ret; |
nothing calls this directly
no test coverage detected