mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-19 11:19:36 +00:00
Accept a Unix socket path with "//" in it
Client took any string with "//" in it that it could not use as a URL for a bad URL, so a Unix socket path such as /run/app//api.sock gave an invalid client. Only a string that starts with a scheme and "://", or with "//", is taken for a URL now.
This commit is contained in:
1 parent
be5043a240
commit
560126bffc
2 files changed
+8
-2
No files matched your search
@@ -173,6 +173,8 @@ TEST_F(UnixSocketTest, pathname) {
|
||||
ASSERT_TRUE(svr.is_running());
|
||||
|
||||
client_GET(pathname_);
|
||||
// ".//x.sock", which is not taken for a URL
|
||||
client_GET("./" + pathname_.substr(1));
|
||||
}
|
||||
|
||||
#if defined(__linux__) || \
|
||||
@@ -15633,6 +15635,8 @@ TEST(HostAndPortPropertiesTest, UserinfoIsNotSupported) {
|
||||
httplib::Client cli("http://user:pass@localhost:1234");
|
||||
ASSERT_FALSE(cli.is_valid());
|
||||
EXPECT_FALSE(cli.Get("/"));
|
||||
|
||||
EXPECT_FALSE(httplib::Client("//user@localhost:1234").is_valid());
|
||||
}
|
||||
|
||||
TEST(HostAndPortPropertiesTest, TrailingCharactersInPort) {
|
||||
|
||||
Reference in new issue
Block a user