mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-03 03:05:18 +02:00
Move a utility function
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include "Common/TimeUtil.h"
|
||||
#include "Common/StringUtils.h"
|
||||
#include "Common/System/OSD.h"
|
||||
#include "Common/System/System.h"
|
||||
|
||||
#include "Common/Net/SocketCompat.h"
|
||||
#include "Common/Net/Resolve.h"
|
||||
@@ -633,4 +634,14 @@ void HTTPRequest::Do() {
|
||||
completed_ = true;
|
||||
}
|
||||
|
||||
std::string RemoveHttpsIfNeeded(std::string_view url) {
|
||||
if (!System_GetPropertyBool(SYSPROP_SUPPORTS_HTTPS)) {
|
||||
// Try with http. Needed on Linux installs currently.
|
||||
if (startsWith(url, "https://")) {
|
||||
return "http://" + std::string(url.substr(8));
|
||||
}
|
||||
}
|
||||
return std::string(url);
|
||||
}
|
||||
|
||||
} // namespace http
|
||||
|
||||
Reference in New Issue
Block a user