1
0
mirror of https://github.com/falk-werner/webfuse-provider synced 2026-03-02 04:09:18 +00:00

added use_tls (determine from URL, whether TLS is used)

This commit is contained in:
Falk Werner
2019-02-23 16:19:00 +01:00
parent d18150d305
commit 9f468f600e
3 changed files with 8 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ TEST(url, ParseWs)
bool result = wsfsp_url_init(&url, "ws://localhost/");
ASSERT_TRUE(result);
ASSERT_EQ(80, url.port);
ASSERT_FALSE(url.use_tls);
ASSERT_STREQ("localhost", url.host);
ASSERT_STREQ("/", url.path);
@@ -20,6 +21,7 @@ TEST(url, ParswWss)
bool result = wsfsp_url_init(&url, "wss://localhost/");
ASSERT_TRUE(result);
ASSERT_EQ(443, url.port);
ASSERT_TRUE(url.use_tls);
ASSERT_STREQ("localhost", url.host);
ASSERT_STREQ("/", url.path);
@@ -81,7 +83,7 @@ TEST(url, FailToParseMissingProtocol)
TEST(url, FailToParseMissingPath)
{
struct wsfsp_url url;
bool result = wsfsp_url_init(&url, "wss://localhost");
bool result = wsfsp_url_init(&url, "ws://localhost");
ASSERT_FALSE(result);
ASSERT_EQ(0, url.port);
ASSERT_EQ(nullptr, url.path);