mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2025-05-15 01:08:27 +00:00
Fix #576
This commit is contained in:
parent
15c4106a36
commit
9ca1fa8b18
2 changed files with 111 additions and 76 deletions
16
test/test.cc
16
test/test.cc
|
@ -100,7 +100,8 @@ TEST(GetHeaderValueTest, DefaultValue) {
|
|||
|
||||
TEST(GetHeaderValueTest, DefaultValueInt) {
|
||||
Headers headers = {{"Dummy", "Dummy"}};
|
||||
auto val = detail::get_header_value_uint64(headers, "Content-Length", 100);
|
||||
auto val =
|
||||
detail::get_header_value<uint64_t>(headers, "Content-Length", 0, 100);
|
||||
EXPECT_EQ(100ull, val);
|
||||
}
|
||||
|
||||
|
@ -112,7 +113,8 @@ TEST(GetHeaderValueTest, RegularValue) {
|
|||
|
||||
TEST(GetHeaderValueTest, RegularValueInt) {
|
||||
Headers headers = {{"Content-Length", "100"}, {"Dummy", "Dummy"}};
|
||||
auto val = detail::get_header_value_uint64(headers, "Content-Length", 0);
|
||||
auto val =
|
||||
detail::get_header_value<uint64_t>(headers, "Content-Length", 0, 0);
|
||||
EXPECT_EQ(100ull, val);
|
||||
}
|
||||
|
||||
|
@ -716,6 +718,16 @@ TEST(RedirectToDifferentPort, Redirect) {
|
|||
ASSERT_FALSE(svr8080.is_running());
|
||||
ASSERT_FALSE(svr8081.is_running());
|
||||
}
|
||||
|
||||
TEST(UrlWithSpace, Redirect) {
|
||||
httplib::SSLClient cli("edge.forgecdn.net");
|
||||
cli.set_follow_location(true);
|
||||
|
||||
auto res = cli.Get("/files/2595/310/Neat 1.4-17.jar");
|
||||
ASSERT_TRUE(res != nullptr);
|
||||
EXPECT_EQ(200, res->status);
|
||||
EXPECT_EQ(18527, res->get_header_value<uint64_t>("Content-Length"));
|
||||
}
|
||||
#endif
|
||||
|
||||
TEST(Server, BindDualStack) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue