Original report by Tim Lundqvist (Bitbucket: Tim Lundqvist).
What steps will reproduce the problem?
Trying to override Accept-Language in CefResourceRequestHandler.onBeforeResourceLoad is no longer possible as that value is ignored/overwritten for the actual request. A Java version of the scenario described here for plain CEF: https://magpcss.org/ceforum/viewtopic.php?f=6&t=17466.
Additionally the accept_language_list is not exposed on the CefSettings class, making it impossible to override the Accept-Language header.
What is the expected output? What do you see instead?
Whether or not the value of the Accept-Language request header is replaced in onBeforeResourceLoad the default value is used.
What version of the product are you using? On what operating system?
Currently I have only personally verified the issue for Windows on 4bb479a (CEF 83.4) and Mac on 5663a27 (CEF 84.3). But as stated in the forum post (linked above) this change in behavior occurred somewhere around version 79 (or at least in the high 70’s). And I see no reason as to this being different on any other OS for any affected version.
Proposed mitigation
Dynamic per-request selection of language is an edge case that shouldn’t be an issue for most implementations. As such, exposing the CefSettings.accept_language_list field and passing it on to CEF should be the preferred option. At least if there is no intention of supporting browser global headers such as Accept-Language and User-Agent to be overridable on a per-request basis.
Original report by Tim Lundqvist (Bitbucket: Tim Lundqvist).
What steps will reproduce the problem?
Trying to override
Accept-LanguageinCefResourceRequestHandler.onBeforeResourceLoadis no longer possible as that value is ignored/overwritten for the actual request. A Java version of the scenario described here for plain CEF: https://magpcss.org/ceforum/viewtopic.php?f=6&t=17466.Additionally the
accept_language_listis not exposed on theCefSettingsclass, making it impossible to override theAccept-Languageheader.What is the expected output? What do you see instead?
Whether or not the value of the
Accept-Languagerequest header is replaced inonBeforeResourceLoadthe default value is used.What version of the product are you using? On what operating system?
Currently I have only personally verified the issue for Windows on 4bb479a (CEF 83.4) and Mac on 5663a27 (CEF 84.3). But as stated in the forum post (linked above) this change in behavior occurred somewhere around version 79 (or at least in the high 70’s). And I see no reason as to this being different on any other OS for any affected version.
Proposed mitigation
Dynamic per-request selection of language is an edge case that shouldn’t be an issue for most implementations. As such, exposing the
CefSettings.accept_language_listfield and passing it on to CEF should be the preferred option. At least if there is no intention of supporting browser global headers such asAccept-LanguageandUser-Agentto be overridable on a per-request basis.