Allow disabling HTTPS through the config file
Simply set: ```ini [General] DisableHTTPS = True ``` Added to help debug issue #17969
This commit is contained in:
parent
b3fafb5fa8
commit
dfe187df1e
6 changed files with 11 additions and 8 deletions
|
@ -5,6 +5,7 @@
|
||||||
#include "Common/StringUtils.h"
|
#include "Common/StringUtils.h"
|
||||||
#include "Common/Log.h"
|
#include "Common/Log.h"
|
||||||
#include "Common/System/OSD.h"
|
#include "Common/System/OSD.h"
|
||||||
|
#include "Common/System/System.h"
|
||||||
|
|
||||||
namespace http {
|
namespace http {
|
||||||
|
|
||||||
|
@ -37,7 +38,7 @@ bool RequestManager::IsHttpsUrl(const std::string &url) {
|
||||||
|
|
||||||
std::shared_ptr<Request> RequestManager::StartDownload(const std::string &url, const Path &outfile, ProgressBarMode mode, const char *acceptMime) {
|
std::shared_ptr<Request> RequestManager::StartDownload(const std::string &url, const Path &outfile, ProgressBarMode mode, const char *acceptMime) {
|
||||||
std::shared_ptr<Request> dl;
|
std::shared_ptr<Request> dl;
|
||||||
if (IsHttpsUrl(url)) {
|
if (IsHttpsUrl(url) && System_GetPropertyBool(SYSPROP_SUPPORTS_HTTPS)) {
|
||||||
#ifndef HTTPS_NOT_AVAILABLE
|
#ifndef HTTPS_NOT_AVAILABLE
|
||||||
dl.reset(new HTTPSRequest(RequestMethod::GET, url, "", "", outfile, mode));
|
dl.reset(new HTTPSRequest(RequestMethod::GET, url, "", "", outfile, mode));
|
||||||
#else
|
#else
|
||||||
|
@ -64,7 +65,7 @@ std::shared_ptr<Request> RequestManager::StartDownloadWithCallback(
|
||||||
const std::string &name,
|
const std::string &name,
|
||||||
const char *acceptMime) {
|
const char *acceptMime) {
|
||||||
std::shared_ptr<Request> dl;
|
std::shared_ptr<Request> dl;
|
||||||
if (IsHttpsUrl(url)) {
|
if (IsHttpsUrl(url) && System_GetPropertyBool(SYSPROP_SUPPORTS_HTTPS)) {
|
||||||
#ifndef HTTPS_NOT_AVAILABLE
|
#ifndef HTTPS_NOT_AVAILABLE
|
||||||
dl.reset(new HTTPSRequest(RequestMethod::GET, url, "", "", outfile, mode, name));
|
dl.reset(new HTTPSRequest(RequestMethod::GET, url, "", "", outfile, mode, name));
|
||||||
#else
|
#else
|
||||||
|
@ -91,7 +92,7 @@ std::shared_ptr<Request> RequestManager::AsyncPostWithCallback(
|
||||||
std::function<void(Request &)> callback,
|
std::function<void(Request &)> callback,
|
||||||
const std::string &name) {
|
const std::string &name) {
|
||||||
std::shared_ptr<Request> dl;
|
std::shared_ptr<Request> dl;
|
||||||
if (IsHttpsUrl(url)) {
|
if (IsHttpsUrl(url) && System_GetPropertyBool(SYSPROP_SUPPORTS_HTTPS)) {
|
||||||
#ifndef HTTPS_NOT_AVAILABLE
|
#ifndef HTTPS_NOT_AVAILABLE
|
||||||
dl.reset(new HTTPSRequest(RequestMethod::POST, url, postData, postMime, Path(), mode, name));
|
dl.reset(new HTTPSRequest(RequestMethod::POST, url, postData, postMime, Path(), mode, name));
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -183,6 +183,7 @@ static const ConfigSetting generalSettings[] = {
|
||||||
ConfigSetting("DiscordPresence", &g_Config.bDiscordPresence, true, CfgFlag::DEFAULT), // Or maybe it makes sense to have it per-game? Race conditions abound...
|
ConfigSetting("DiscordPresence", &g_Config.bDiscordPresence, true, CfgFlag::DEFAULT), // Or maybe it makes sense to have it per-game? Race conditions abound...
|
||||||
ConfigSetting("UISound", &g_Config.bUISound, false, CfgFlag::DEFAULT),
|
ConfigSetting("UISound", &g_Config.bUISound, false, CfgFlag::DEFAULT),
|
||||||
|
|
||||||
|
ConfigSetting("DisableHTTPS", &g_Config.bDisableHTTPS, false, CfgFlag::DONT_SAVE),
|
||||||
ConfigSetting("AutoLoadSaveState", &g_Config.iAutoLoadSaveState, 0, CfgFlag::PER_GAME),
|
ConfigSetting("AutoLoadSaveState", &g_Config.iAutoLoadSaveState, 0, CfgFlag::PER_GAME),
|
||||||
ConfigSetting("EnableCheats", &g_Config.bEnableCheats, false, CfgFlag::PER_GAME | CfgFlag::REPORT),
|
ConfigSetting("EnableCheats", &g_Config.bEnableCheats, false, CfgFlag::PER_GAME | CfgFlag::REPORT),
|
||||||
ConfigSetting("CwCheatRefreshRate", &g_Config.iCwCheatRefreshRate, 77, CfgFlag::PER_GAME),
|
ConfigSetting("CwCheatRefreshRate", &g_Config.iCwCheatRefreshRate, 77, CfgFlag::PER_GAME),
|
||||||
|
|
|
@ -92,6 +92,8 @@ public:
|
||||||
bool bPreloadFunctions;
|
bool bPreloadFunctions;
|
||||||
uint32_t uJitDisableFlags;
|
uint32_t uJitDisableFlags;
|
||||||
|
|
||||||
|
bool bDisableHTTPS;
|
||||||
|
|
||||||
bool bSeparateSASThread;
|
bool bSeparateSASThread;
|
||||||
int iIOTimingMethod;
|
int iIOTimingMethod;
|
||||||
int iLockedCPUSpeed;
|
int iLockedCPUSpeed;
|
||||||
|
|
|
@ -573,7 +573,7 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
||||||
return true; // FileUtil.cpp: OpenFileInEditor
|
return true; // FileUtil.cpp: OpenFileInEditor
|
||||||
#ifndef HTTPS_NOT_AVAILABLE
|
#ifndef HTTPS_NOT_AVAILABLE
|
||||||
case SYSPROP_SUPPORTS_HTTPS:
|
case SYSPROP_SUPPORTS_HTTPS:
|
||||||
return true;
|
return !g_Config.bDisableHTTPS;
|
||||||
#endif
|
#endif
|
||||||
#if PPSSPP_PLATFORM(MAC)
|
#if PPSSPP_PLATFORM(MAC)
|
||||||
case SYSPROP_HAS_FOLDER_BROWSER:
|
case SYSPROP_HAS_FOLDER_BROWSER:
|
||||||
|
|
|
@ -374,7 +374,7 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
||||||
case SYSPROP_SUPPORTS_OPEN_FILE_IN_EDITOR:
|
case SYSPROP_SUPPORTS_OPEN_FILE_IN_EDITOR:
|
||||||
return true; // FileUtil.cpp: OpenFileInEditor
|
return true; // FileUtil.cpp: OpenFileInEditor
|
||||||
case SYSPROP_SUPPORTS_HTTPS:
|
case SYSPROP_SUPPORTS_HTTPS:
|
||||||
return true;
|
return !g_Config.bDisableHTTPS;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -597,7 +597,7 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
|
||||||
|
|
||||||
case SystemRequestType::SHOW_FILE_IN_FOLDER:
|
case SystemRequestType::SHOW_FILE_IN_FOLDER:
|
||||||
W32Util::ShowFileInFolder(param1);
|
W32Util::ShowFileInFolder(param1);
|
||||||
break;
|
return true;
|
||||||
|
|
||||||
case SystemRequestType::TOGGLE_FULLSCREEN_STATE:
|
case SystemRequestType::TOGGLE_FULLSCREEN_STATE:
|
||||||
{
|
{
|
||||||
|
@ -620,7 +620,6 @@ bool System_MakeRequest(SystemRequestType type, int requestId, const std::string
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
case SystemRequestType::CREATE_GAME_SHORTCUT:
|
case SystemRequestType::CREATE_GAME_SHORTCUT:
|
||||||
// This is not actually working, but ported it to the request framework anyway.
|
|
||||||
return W32Util::CreateDesktopShortcut(param1, param2);
|
return W32Util::CreateDesktopShortcut(param1, param2);
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -533,7 +533,7 @@ bool System_GetPropertyBool(SystemProperty prop) {
|
||||||
return deviceType != DEVICE_TYPE_VR;
|
return deviceType != DEVICE_TYPE_VR;
|
||||||
#ifndef HTTPS_NOT_AVAILABLE
|
#ifndef HTTPS_NOT_AVAILABLE
|
||||||
case SYSPROP_SUPPORTS_HTTPS:
|
case SYSPROP_SUPPORTS_HTTPS:
|
||||||
return true;
|
return !g_Config.bDisableHTTPS;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue