summaryrefslogtreecommitdiffstats
path: root/library/cpp/http/io
diff options
context:
space:
mode:
authorfeldsherov <[email protected]>2022-02-10 16:49:29 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:49:29 +0300
commite73723ec73b27276cd45b9b46b752138a51d669c (patch)
tree055f8efa1a290665c7be6bb571131e050cd9517a /library/cpp/http/io
parent4d75b7f76712a8150bd526a7ef43d279d9892eb7 (diff)
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/http/io')
-rw-r--r--library/cpp/http/io/stream.cpp6
-rw-r--r--library/cpp/http/io/stream_ut.cpp84
2 files changed, 45 insertions, 45 deletions
diff --git a/library/cpp/http/io/stream.cpp b/library/cpp/http/io/stream.cpp
index 6689be684fc..71f4b9f927a 100644
--- a/library/cpp/http/io/stream.cpp
+++ b/library/cpp/http/io/stream.cpp
@@ -436,10 +436,10 @@ TString THttpInput::BestCompressionScheme(TArrayRef<const TStringBuf> codings) c
);
}
-TString THttpInput::BestCompressionScheme() const {
+TString THttpInput::BestCompressionScheme() const {
return BestCompressionScheme(TCompressionCodecFactory::Instance().GetBestCodecs());
-}
-
+}
+
bool THttpInput::GetContentLength(ui64& value) const noexcept {
return Impl_->GetContentLength(value);
}
diff --git a/library/cpp/http/io/stream_ut.cpp b/library/cpp/http/io/stream_ut.cpp
index 1ea35df675a..deabe5de45c 100644
--- a/library/cpp/http/io/stream_ut.cpp
+++ b/library/cpp/http/io/stream_ut.cpp
@@ -441,52 +441,52 @@ Y_UNIT_TEST_SUITE(THttpStreamTest) {
UNIT_ASSERT(!result.Contains("content-length"));
}
- Y_UNIT_TEST(CodecsPriority) {
- TMemoryInput request("GET / HTTP/1.1\r\nAccept-Encoding: gzip, br\r\n\r\n");
+ Y_UNIT_TEST(CodecsPriority) {
+ TMemoryInput request("GET / HTTP/1.1\r\nAccept-Encoding: gzip, br\r\n\r\n");
TVector<TStringBuf> codecs = {"br", "gzip"};
-
- THttpInput i(&request);
- TString result;
- TStringOutput out(result);
- THttpOutput httpOut(&out, &i);
-
- httpOut.EnableKeepAlive(true);
+
+ THttpInput i(&request);
+ TString result;
+ TStringOutput out(result);
+ THttpOutput httpOut(&out, &i);
+
+ httpOut.EnableKeepAlive(true);
httpOut.EnableCompression(codecs);
- httpOut << "HTTP/1.1 200 OK\r\n";
- char answer[] = "Mary had a little lamb.";
- httpOut << "Content-Length: " << strlen(answer) << "\r\n"
- "\r\n";
- httpOut << answer;
- httpOut.Finish();
-
- Cdbg << result;
- result.to_lower();
- UNIT_ASSERT(result.Contains("content-encoding: br"));
- }
-
- Y_UNIT_TEST(CodecsPriority2) {
- TMemoryInput request("GET / HTTP/1.1\r\nAccept-Encoding: gzip, br\r\n\r\n");
+ httpOut << "HTTP/1.1 200 OK\r\n";
+ char answer[] = "Mary had a little lamb.";
+ httpOut << "Content-Length: " << strlen(answer) << "\r\n"
+ "\r\n";
+ httpOut << answer;
+ httpOut.Finish();
+
+ Cdbg << result;
+ result.to_lower();
+ UNIT_ASSERT(result.Contains("content-encoding: br"));
+ }
+
+ Y_UNIT_TEST(CodecsPriority2) {
+ TMemoryInput request("GET / HTTP/1.1\r\nAccept-Encoding: gzip, br\r\n\r\n");
TVector<TStringBuf> codecs = {"gzip", "br"};
-
- THttpInput i(&request);
- TString result;
- TStringOutput out(result);
- THttpOutput httpOut(&out, &i);
-
- httpOut.EnableKeepAlive(true);
+
+ THttpInput i(&request);
+ TString result;
+ TStringOutput out(result);
+ THttpOutput httpOut(&out, &i);
+
+ httpOut.EnableKeepAlive(true);
httpOut.EnableCompression(codecs);
- httpOut << "HTTP/1.1 200 OK\r\n";
- char answer[] = "Mary had a little lamb.";
- httpOut << "Content-Length: " << strlen(answer) << "\r\n"
- "\r\n";
- httpOut << answer;
- httpOut.Finish();
-
- Cdbg << result;
- result.to_lower();
- UNIT_ASSERT(result.Contains("content-encoding: gzip"));
- }
-
+ httpOut << "HTTP/1.1 200 OK\r\n";
+ char answer[] = "Mary had a little lamb.";
+ httpOut << "Content-Length: " << strlen(answer) << "\r\n"
+ "\r\n";
+ httpOut << answer;
+ httpOut.Finish();
+
+ Cdbg << result;
+ result.to_lower();
+ UNIT_ASSERT(result.Contains("content-encoding: gzip"));
+ }
+
Y_UNIT_TEST(HasTrailers) {
TMemoryInput response(
"HTTP/1.1 200 OK\r\n"