From c86c6e55a8a50d1dc76f17ab076385e7f35f0341 Mon Sep 17 00:00:00 2001 From: ANR2ME Date: Mon, 4 Sep 2023 01:17:02 +0700 Subject: [PATCH] Fixes Invalid URL issue during sceHttpSendRequest on LittleBigPlanet --- Core/HLE/sceHttp.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceHttp.cpp b/Core/HLE/sceHttp.cpp index 163e18fd38..0a00e18ba0 100644 --- a/Core/HLE/sceHttp.cpp +++ b/Core/HLE/sceHttp.cpp @@ -218,7 +218,13 @@ int HTTPRequest::sendRequest(u32 postDataPtr, u32 postDataSize) { // TODO: Do this on a separate thread, since this may blocks "Emu" thread here // Try to resolve first - Url fileUrl(url); + // Note: LittleBigPlanet onlu passed the path (ie. /LITTLEBIGPLANETPSP_XML/login?) during sceHttpCreateRequest without the host domain, thus will need to be construced into a valid URI using the data from sceHttpCreateConnection upon validating/parsing the URL. + std::string fullURL = url; + if (startsWithNoCase(url, "/")) { + fullURL = scheme + "://" + hostString + ":" + std::to_string(port) + fullURL; + } + + Url fileUrl(fullURL); if (!fileUrl.Valid()) { return SCE_HTTP_ERROR_INVALID_URL; } @@ -328,7 +334,7 @@ int sceHttpSetResolveRetry(int id, int retryCount) { } static int sceHttpInit(int poolSize) { - WARN_LOG(Log::sceNet, "UNTESTED sceHttpInit(%i)", poolSize); + WARN_LOG(Log::sceNet, "UNTESTED sceHttpInit(%i) at %08x", poolSize, currentMIPS->pc); if (httpInited) return hleLogError(Log::sceNet, SCE_HTTP_ERROR_ALREADY_INITED, "http already inited");