From 4cadf8d3bceb7a1bf419a44503072c3bce9913a7 Mon Sep 17 00:00:00 2001 From: Richard Walters Date: Mon, 2 Jul 2018 22:46:12 -0700 Subject: Recognize special case of absolute URI with empty path Such a URI should be considered equivalent to a path of "/" because in both cases the path is an absolute path. --- src/Uri.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/Uri.cpp b/src/Uri.cpp index 309ce88..2d549c2 100644 --- a/src/Uri.cpp +++ b/src/Uri.cpp @@ -671,6 +671,15 @@ namespace Uri { return false; } + // Handle special case of absolute URI with empty + // path -- treat the same as "/" path. + if ( + !impl_->scheme.empty() + && impl_->path.empty() + ) { + impl_->path.push_back(""); + } + // Next, parse the fragment if there is one. if (!impl_->ParseFragment(queryAndOrFragment, rest)) { return false; -- cgit v1.2.3