diff --git a/lib/http_parser.cpp b/lib/http_parser.cpp index 3c619df5..eed2acc9 100644 --- a/lib/http_parser.cpp +++ b/lib/http_parser.cpp @@ -182,6 +182,11 @@ std::string HTTP::URL::getUrl() const{ return ret; } +/// Returns the full file path, in case this is a local file URI +std::string HTTP::URL::getFilePath() const{ + return "/"+path; +} + /// Returns the URL in string format without auth and frag std::string HTTP::URL::getProxyUrl() const{ std::string ret; diff --git a/lib/http_parser.h b/lib/http_parser.h index 53dccbbe..37803b2f 100644 --- a/lib/http_parser.h +++ b/lib/http_parser.h @@ -79,6 +79,7 @@ namespace HTTP{ uint32_t getPort() const; uint32_t getDefaultPort() const; std::string getUrl() const; + std::string getFilePath() const; std::string getBareUrl() const; std::string getProxyUrl() const; std::string host; ///< Hostname or IP address of URL