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
|
@ -211,12 +211,15 @@ std::string HTTP::URL::getFilePath() const{
|
||||||
|
|
||||||
/// Returns whether the URL is probably pointing to a local file
|
/// Returns whether the URL is probably pointing to a local file
|
||||||
bool HTTP::URL::isLocalPath() const{
|
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 we have no host, protocol or port we can assume it is a local path
|
||||||
if (host.size() || protocol.size() || port.size()){
|
if (!host.size() && !protocol.size() && !port.size()){return true;}
|
||||||
|
|
||||||
|
//Anything else is probably not local
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Returns the URL in string format without auth and frag
|
/// Returns the URL in string format without auth and frag
|
||||||
std::string HTTP::URL::getProxyUrl() const{
|
std::string HTTP::URL::getProxyUrl() const{
|
||||||
|
|
Loading…
Add table
Reference in a new issue