Skip to content

Commit

Permalink
fix: Fix overlay browser not loading on pages without a response phrase.
Browse files Browse the repository at this point in the history
  • Loading branch information
shdwmtr committed Dec 29, 2024
1 parent 2501c85 commit 7d0fbcf
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/hooks/web_load.cc
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,17 @@ void WebkitHandler::HandleHooks(nlohmann::basic_json<> message)

BypassCSP();

const int responseCode = response["params"].value("responseStatusCode", 200);
const std::string responseMessage = response["params"].value("responseStatusText", "OK");

Sockets::PostGlobal({
{ "id", 63453 },
{ "method", "Fetch.fulfillRequest" },
{ "params", {
{ "requestId", requestId },
{ "responseCode", response["params"]["responseStatusCode"] },
{ "responseCode", responseCode },
{ "responseHeaders", response["params"]["responseHeaders"] },
{ "responsePhrase", response["params"]["responseStatusText"] },
{ "responsePhrase", responseMessage.length() > 0 ? responseMessage : "OK" },
{ "body", Base64Encode(patchedContent) }
}}
});
Expand Down

0 comments on commit 7d0fbcf

Please sign in to comment.