diff --git a/lib/url.cpp b/lib/url.cpp index 68b8ea26..1dc89ba5 100644 --- a/lib/url.cpp +++ b/lib/url.cpp @@ -211,11 +211,14 @@ std::string HTTP::URL::getFilePath() const{ /// Returns whether the URL is probably pointing to a local file bool HTTP::URL::isLocalPath() const{ + //Anything with a "file" protocol is explicitly a local file + if (protocol == "file"){return true;} + // If we have no host, protocol or port we can assume it is a local path - if (host.size() || protocol.size() || port.size()){ - return false; - } - return true; + if (!host.size() && !protocol.size() && !port.size()){return true;} + + //Anything else is probably not local + return false; } /// Returns the URL in string format without auth and frag