summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShobhit Adlakha <adlakhashobhit@gmail.com>2019-05-22 16:37:02 -0400
committerShobhit Adlakha <adlakhashobhit@gmail.com>2019-05-22 16:37:02 -0400
commit55774daed1c1b862a914b31bd41dab7d18101627 (patch)
treee8eae7e045eeaf97b31dba19feb7e2fb9844209a
parentc7afcf60185bf9b62c2ccd639f3e5b03a55f51f1 (diff)
downloadsdl_core-fix/cloud_app_endpoint_with_path.tar.gz
regex fix for rejecting empty hostnamefix/cloud_app_endpoint_with_path
-rw-r--r--src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc2
-rw-r--r--src/components/transport_manager/test/transport_adapter_test.cc1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc b/src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc
index 416ecb47a0..622531b120 100644
--- a/src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc
+++ b/src/components/transport_manager/src/cloud/cloud_websocket_transport_adapter.cc
@@ -82,7 +82,7 @@ void CloudWebsocketTransportAdapter::CreateDevice(const std::string& uid) {
std::string protocol_pattern = "(wss?)";
std::string host_pattern =
- "(([^?#%\\\\/@:\\s]*)\\:?([^?#%\\\\/@\\s]*)\\@?([^?#%\\\\/\\s]*))";
+ "(([^?#%\\\\/@:\\s]{1,})\\:?([^?#%\\\\/@\\s]*)\\@?([^?#%\\\\/\\s]*))";
std::string port_pattern = "(\\d{2,5})";
// Optional parameters
std::string path_pattern = "((\\/[^\\/#?\\s]+)*)?\\/?";
diff --git a/src/components/transport_manager/test/transport_adapter_test.cc b/src/components/transport_manager/test/transport_adapter_test.cc
index 65698b911a..56386db201 100644
--- a/src/components/transport_manager/test/transport_adapter_test.cc
+++ b/src/components/transport_manager/test/transport_adapter_test.cc
@@ -163,6 +163,7 @@ class TransportAdapterTest : public ::testing::Test {
TestEndpoint{"local/host:80", "local/host", "80", "/"},
TestEndpoint{"local host:80", "local host", "80", "/"},
TestEndpoint{"local\thost:80", "local\thost", "80", "/"},
+ TestEndpoint{":80#section1", "", "80", "/#section1"},
// Invalid port
TestEndpoint{"username:password@localhost.com",
"username:password@localhost.com",