It's not possible to override the Accept-Language request header #4665
StefanoRaffaelli
started this conversation in
General
Replies: 1 comment
-
Converting to discussion as this isn't a bug.
It's not possible to set There's an open issue to improve this chromiumembedded/cef#2881 Use either |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there an existing issue for this?
CefSharp Version
120.1.110.0
Operating System
Windows 11
Architecture
x64
.Net Version
.NET 4.8
Implementation
WinForms
Reproduction Steps
I have replicated the problem using the last version of CefSharp.MinimalExample that uses the 120.1.110.0 CEF version
I have modified BrowserForm.cs adding these pieces of code:
Into the BrowserForm constructor I have added
browser.RequestHandler = new CustomRequestHandler();
Here the CustomRequestHandler implementation
as you can see I have overridden the Accept-Language header and I have also added a new custom header.
When I debug the code I see that
request.Headers
contains the 'it-IT' value into the Accept-Language header , but when I see the request of the URL on devtools the Accept-Language contains only the default value (en-US,en;q=0.9)Note that no other changes were made to the original project (CefSharp.MinimalExample)
Expected behavior
I expect the request to the URL to have the Accept-Language header modified (in my case must contains the 'it-IT' value) and the custom header added
Actual behavior
The request starts with the default Accept-Language header but the CustomHeader is correctly added to the request. Below, the request headers from the dev-tools form
Regression?
In my opinion, it's not a regression because in my application I have used the CEF 107.1.90.0 version and I have the same behavior
Known Workarounds
No response
Does this problem also occur in the CEF Sample Application
Not Tested
Other information
No response
Beta Was this translation helpful? Give feedback.
All reactions