diff --git a/Core/WebServer.cpp b/Core/WebServer.cpp index 284c1c0333..92fb5b2c39 100644 --- a/Core/WebServer.cpp +++ b/Core/WebServer.cpp @@ -106,6 +106,23 @@ static void RegisterServer(int port) { } } +bool RemoteISOFileSupported(const std::string &filename) { + // Disc-like files. + if (endsWithNoCase(filename, ".cso") || endsWithNoCase(filename, ".iso")) { + return true; + } + // May work - but won't have supporting files. + if (endsWithNoCase(filename, ".pbp")) { + return true; + } + // Debugging files. + if (endsWithNoCase(filename, ".ppdmp")) { + return true; + } + return false; + +} + static void RegisterDiscHandlers(http::Server *http, std::unordered_map *paths) { for (std::string filename : g_Config.recentIsos) { #ifdef _WIN32 @@ -118,7 +135,7 @@ static void RegisterDiscHandlers(http::Server *http, std::unordered_map responseHeaders; - std::string subdir ="/"; + std::string subdir = "/"; size_t offset; if (g_Config.bRemoteISOManual) { subdir = g_Config.sRemoteISOSubdir; offset=subdir.find_last_of("/"); if (offset != subdir.length() - 1 && offset != subdir.npos) { - //truncate everything after last / + // Truncate everything after last / subdir.erase(offset + 1); } } @@ -136,7 +136,7 @@ static bool LoadGameList(const std::string &host, int port, std::vector