summaryrefslogtreecommitdiff
path: root/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-change-http-accept-header.patch
diff options
context:
space:
mode:
Diffstat (limited to 'www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-change-http-accept-header.patch')
-rw-r--r--www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-change-http-accept-header.patch49
1 files changed, 0 insertions, 49 deletions
diff --git a/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-change-http-accept-header.patch b/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-change-http-accept-header.patch
deleted file mode 100644
index ede83e7..0000000
--- a/www/chromium-uc/patches/extra/ungoogled-chromium/add-flag-to-change-http-accept-header.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1--- a/chrome/browser/ungoogled_flag_entries.h
2+++ b/chrome/browser/ungoogled_flag_entries.h
3@@ -96,4 +96,8 @@
4 "Disable GREASE for TLS",
5 "Turn off GREASE (Generate Random Extensions And Sustain Extensibility) for TLS connections. ungoogled-chromium flag.",
6 kOsAll, SINGLE_VALUE_TYPE("disable-grease-tls")},
7+ {"http-accept-header",
8+ "Custom HTTP Accept Header",
9+ "Set a custom value for the Accept header which is sent by the browser with every HTTP request. (e.g. `text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8`). ungoogled-chromium flag.",
10+ kOsAll, ORIGIN_LIST_VALUE_TYPE("http-accept-header", "")},
11 #endif // CHROME_BROWSER_UNGOOGLED_FLAG_ENTRIES_H_
12--- a/components/flags_ui/flags_state.cc
13+++ b/components/flags_ui/flags_state.cc
14@@ -209,6 +209,7 @@ std::string GetCombinedOriginListValue(c
15 const std::string new_value =
16 flags_storage.GetOriginListFlag(internal_entry_name);
17 if (command_line_switch == "custom-ntp") return existing_value.empty() ? new_value : existing_value;
18+ if (command_line_switch == "http-accept-header") return existing_value.empty() ? new_value : existing_value;
19 return CombineAndSanitizeOriginLists(existing_value, new_value);
20 }
21
22@@ -398,6 +399,7 @@ void FlagsState::SetOriginListFlag(const
23 FlagsStorage* flags_storage) {
24 const std::string new_value =
25 internal_name == "custom-ntp" ? value :
26+ internal_name == "http-accept-header" ? value :
27 CombineAndSanitizeOriginLists(std::string(), value);
28 flags_storage->SetOriginListFlag(internal_name, new_value);
29
30--- a/content/public/browser/frame_accept_header.cc
31+++ b/content/public/browser/frame_accept_header.cc
32@@ -4,6 +4,7 @@
33
34 #include "content/public/browser/frame_accept_header.h"
35
36+#include "base/command_line.h"
37 #include "content/browser/web_package/signed_exchange_consts.h"
38 #include "content/browser/web_package/signed_exchange_utils.h"
39 #include "content/common/content_constants_internal.h"
40@@ -14,6 +15,9 @@ namespace content {
41
42 std::string FrameAcceptHeaderValue(bool allow_sxg_responses,
43 BrowserContext* browser_context) {
44+ if (base::CommandLine::ForCurrentProcess()->HasSwitch("http-accept-header"))
45+ return base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("http-accept-header");
46+
47 std::string header_value = kFrameAcceptHeaderValue;
48
49 #if BUILDFLAG(ENABLE_JXL_DECODER)