http: Don't treat http:// as a relative path.

This commit is contained in:
Unknown W. Brackets 2019-10-06 08:30:39 -07:00
parent bf1777f7d3
commit 78571b8e37
2 changed files with 4 additions and 1 deletions

View file

@ -136,6 +136,9 @@ static bool ResolvePathVista(const std::wstring &path, wchar_t *buf, DWORD bufSi
#endif #endif
std::string ResolvePath(const std::string &path) { std::string ResolvePath(const std::string &path) {
if (startsWith(path, "http://") || startsWith(path, "https://")) {
return path;
}
#ifdef _WIN32 #ifdef _WIN32
static const int BUF_SIZE = 32768; static const int BUF_SIZE = 32768;
wchar_t *buf = new wchar_t[BUF_SIZE] {}; wchar_t *buf = new wchar_t[BUF_SIZE] {};

View file

@ -43,7 +43,7 @@ std::string ResolveUrl(std::string baseUrl, std::string url) {
return baseUrl; return baseUrl;
} else if (url[0] == '/') { } else if (url[0] == '/') {
return baseUrl + url.substr(1); return baseUrl + url.substr(1);
} else if (url.substr(0, 7) == "http://") { } else if (startsWith(url, "http://") || startsWith(url, "https://")) {
return url; return url;
} else { } else {
// Huh. // Huh.