mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-29 16:51:20 +00:00
net: accept a NULL user agent in sceHttpCreateTemplate (Cyberpunk 2077)
This commit is contained in:
1 parent
f9e14084d6
commit
87e815b250
2 files changed
+14
-1
No files matched your search
@@ -466,7 +466,7 @@ Network::Id Network::HttpCreateTemplate(Id http_ctx_id, const char* user_agent,
|
|||||||
HttpTemplate tn {};
|
HttpTemplate tn {};
|
||||||
tn.used = true;
|
tn.used = true;
|
||||||
tn.http_ver = http_ver;
|
tn.http_ver = http_ver;
|
||||||
tn.user_agent = std::string(user_agent);
|
tn.user_agent = user_agent != nullptr ? user_agent : "";
|
||||||
tn.is_auto_proxy_conf = is_auto_proxy_conf;
|
tn.is_auto_proxy_conf = is_auto_proxy_conf;
|
||||||
tn.http_ctx_id = http_ctx_id.GetId();
|
tn.http_ctx_id = http_ctx_id.GetId();
|
||||||
tn.nonblock = false;
|
tn.nonblock = false;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "common/abi.h"
|
#include "common/abi.h"
|
||||||
|
#include "libs/network.h"
|
||||||
#include "loader/symbolDatabase.h"
|
#include "loader/symbolDatabase.h"
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
@@ -162,6 +163,17 @@ void TestBuildHonoursOption(HttpUriParse parse, HttpUriBuild build) {
|
|||||||
CHECK(BuildWith(build, element, 0) == url);
|
CHECK(BuildWith(build, element, 0) == url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cyberpunk 2077 (PPSA03974) creates a template with a NULL user agent.
|
||||||
|
void TestTemplateWithoutUserAgent() {
|
||||||
|
using namespace Libs::Network;
|
||||||
|
Initialize();
|
||||||
|
const int pool = Net::NetPoolCreate("http", 0x10000, 0);
|
||||||
|
const int ssl = Ssl::SslInit(0x10000);
|
||||||
|
const int http = Http::HttpInit(pool, ssl, 0x10000);
|
||||||
|
CHECK(Http::HttpCreateTemplate(http, nullptr, 2, 1) > 0);
|
||||||
|
Shutdown();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
@@ -176,5 +188,6 @@ int main() {
|
|||||||
TestAbsentQuery(parse);
|
TestAbsentQuery(parse);
|
||||||
TestEmptyUri(parse);
|
TestEmptyUri(parse);
|
||||||
TestPresentQuery(parse);
|
TestPresentQuery(parse);
|
||||||
|
TestTemplateWithoutUserAgent();
|
||||||
return failures == 0 ? 0 : 1;
|
return failures == 0 ? 0 : 1;
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user