[icinga-checkins] icinga.org: icinga2/feature/check_nscp-12874: Fix Url parser when using path only

git at icinga.org git at icinga.org
Thu Dec 8 13:49:51 CET 2016


Module: icinga2
Branch: feature/check_nscp-12874
Commit: 21737a78dede538a26d78d4a267c60b2faa949ff
URL:    https://git.icinga.org/?p=icinga2.git;a=commit;h=21737a78dede538a26d78d4a267c60b2faa949ff

Author: Jean Flach <jean-marcel.flach at icinga.com>
Date:   Thu Dec  8 12:24:40 2016 +0100

Fix Url parser when using path only

refs #12874

---

 lib/remote/url.cpp |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/remote/url.cpp b/lib/remote/url.cpp
index 77074af..dfe5e24 100644
--- a/lib/remote/url.cpp
+++ b/lib/remote/url.cpp
@@ -36,7 +36,9 @@ Url::Url(const String& base_url)
 	if (url.GetLength() == 0)
 		BOOST_THROW_EXCEPTION(std::invalid_argument("Invalid URL Empty URL."));
 
-	size_t pHelper = url.Find(":");
+	size_t pHelper = String::NPos;
+	if (url[0] != '/')
+		pHelper = url.Find(":");
 
 	if (pHelper != String::NPos) {
 		if (!ParseScheme(url.SubStr(0, pHelper)))



More information about the icinga-checkins mailing list