mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-11-16 19:20:50 +00:00
Support for deflate compression (#360)
This commit is contained in:
1 parent
9a663aa94e
commit
f2bb9c45d6
2 files changed
+24
-8
No files matched your search
@@ -1705,6 +1705,19 @@ TEST_F(ServerTest, PutLargeFileWithGzip) {
|
||||
EXPECT_EQ(200, res->status);
|
||||
EXPECT_EQ(LARGE_DATA, res->body);
|
||||
}
|
||||
|
||||
TEST_F(ServerTest, PutContentWithDeflate) {
|
||||
cli_.set_compress(false);
|
||||
httplib::Headers headers;
|
||||
headers.emplace("Content-Encoding", "deflate");
|
||||
// PUT in deflate format:
|
||||
auto res = cli_.Put("/put", headers, "\170\234\013\010\015\001\0\001\361\0\372", "text/plain");
|
||||
|
||||
ASSERT_TRUE(res != nullptr);
|
||||
EXPECT_EQ(200, res->status);
|
||||
EXPECT_EQ("PUT", res->body);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
TEST_F(ServerTest, Patch) {
|
||||
|
||||
Reference in new issue
Block a user