mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-14 16:58:30 +00:00
Fix #1772
This commit is contained in:
parent
f06fd934f6
commit
9d6f5372a3
2 changed files with 38 additions and 22 deletions
11
test/test.cc
11
test/test.cc
|
@ -2166,6 +2166,11 @@ protected:
|
|||
EXPECT_EQ("4", req.get_header_value("Content-Length"));
|
||||
res.set_content(req.body, "application/octet-stream");
|
||||
})
|
||||
.Get("/issue1772",
|
||||
[&](const Request & /*req*/, Response &res) {
|
||||
res.status = 401;
|
||||
res.set_header("WWW-Authenticate", "Basic realm=123456");
|
||||
})
|
||||
#if defined(CPPHTTPLIB_ZLIB_SUPPORT) || defined(CPPHTTPLIB_BROTLI_SUPPORT)
|
||||
.Get("/compress",
|
||||
[&](const Request & /*req*/, Response &res) {
|
||||
|
@ -3139,6 +3144,12 @@ TEST_F(ServerTest, GetWithRangeMultipartOffsetGreaterThanContent) {
|
|||
EXPECT_EQ(StatusCode::RangeNotSatisfiable_416, res->status);
|
||||
}
|
||||
|
||||
TEST_F(ServerTest, Issue1772) {
|
||||
auto res = cli_.Get("/issue1772", {{make_range_header({{1000, -1}})}});
|
||||
ASSERT_TRUE(res);
|
||||
EXPECT_EQ(StatusCode::Unauthorized_401, res->status);
|
||||
}
|
||||
|
||||
TEST_F(ServerTest, GetStreamedChunked) {
|
||||
auto res = cli_.Get("/streamed-chunked");
|
||||
ASSERT_TRUE(res);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue