aboutsummaryrefslogtreecommitdiff
path: root/src/Uri.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Uri.cpp')
-rw-r--r--src/Uri.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Uri.cpp b/src/Uri.cpp
index 1a82ee8..e218ecd 100644
--- a/src/Uri.cpp
+++ b/src/Uri.cpp
@@ -330,7 +330,11 @@ namespace Uri {
bool Uri::ParseFromString(const std::string& uriString) {
// First parse the scheme.
- const auto schemeEnd = uriString.find(':');
+ auto authorityDelimiter = uriString.find("//");
+ if (authorityDelimiter == std::string::npos) {
+ authorityDelimiter = uriString.length();
+ }
+ const auto schemeEnd = uriString.substr(0, authorityDelimiter).find(':');
std::string rest;
if (schemeEnd == std::string::npos) {
impl_->scheme.clear();