Fix detection of local paths in URL library
This commit is contained in:
parent
a8139e1b99
commit
7c36de707f
1 changed files with 7 additions and 4 deletions
11
lib/url.cpp
11
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
|
||||
|
|
Loading…
Add table
Reference in a new issue