mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-18 17:00:30 +02:00
Move a utility function
This commit is contained in:
1 parent
32799755e6
commit
d4bd7c604c
3 files changed
+15
-12
No files matched your search
@@ -51,16 +51,6 @@ static int ParsePortValue(const rapidjson::Value &v) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
static 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);
|
||||
}
|
||||
|
||||
std::vector<AdhocGame> ParseStatusXML(const std::string& xmlInput) {
|
||||
pugi::xml_document doc;
|
||||
pugi::xml_parse_result result = doc.load_string(xmlInput.c_str());
|
||||
@@ -301,9 +291,9 @@ AdhocServerInfoScreen::AdhocServerInfoScreen(const AdhocServerListEntry &entry)
|
||||
|
||||
std::string dataUrl;
|
||||
if (!entry.dataJsonUrl.empty()) {
|
||||
dataUrl = RemoveHttpsIfNeeded(entry.dataJsonUrl);
|
||||
dataUrl = http::RemoveHttpsIfNeeded(entry.dataJsonUrl);
|
||||
} else if (!entry.statusXmlUrl.empty()) {
|
||||
dataUrl = RemoveHttpsIfNeeded(entry.statusXmlUrl);
|
||||
dataUrl = http::RemoveHttpsIfNeeded(entry.statusXmlUrl);
|
||||
}
|
||||
|
||||
if (!dataUrl.empty()) {
|
||||
|
||||
Reference in new issue
Block a user