From 78571b8e37c66acbda461f12b27203b35557b9ca Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 6 Oct 2019 08:30:39 -0700 Subject: [PATCH] http: Don't treat http:// as a relative path. --- Common/FileUtil.cpp | 3 +++ UI/Store.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Common/FileUtil.cpp b/Common/FileUtil.cpp index 7b9e8259b7..04ae730c1c 100644 --- a/Common/FileUtil.cpp +++ b/Common/FileUtil.cpp @@ -136,6 +136,9 @@ static bool ResolvePathVista(const std::wstring &path, wchar_t *buf, DWORD bufSi #endif std::string ResolvePath(const std::string &path) { + if (startsWith(path, "http://") || startsWith(path, "https://")) { + return path; + } #ifdef _WIN32 static const int BUF_SIZE = 32768; wchar_t *buf = new wchar_t[BUF_SIZE] {}; diff --git a/UI/Store.cpp b/UI/Store.cpp index f403505c65..254843afa3 100644 --- a/UI/Store.cpp +++ b/UI/Store.cpp @@ -43,7 +43,7 @@ std::string ResolveUrl(std::string baseUrl, std::string url) { return baseUrl; } else if (url[0] == '/') { return baseUrl + url.substr(1); - } else if (url.substr(0, 7) == "http://") { + } else if (startsWith(url, "http://") || startsWith(url, "https://")) { return url; } else { // Huh.