mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
Support for deflate compression (#360)
This commit is contained in:
parent
9a663aa94e
commit
f2bb9c45d6
2 changed files with 24 additions and 8 deletions
13
test/test.cc
13
test/test.cc
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue