-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom http headers set in WebViewHandler are not sent #12206
Comments
This is really important for our application as well please look into this |
I found a workaround on this by overriding I also found something weird with MAUI WebView control. If I ignore the Below is the workaround to get the headers transmitted. Android
iOS
|
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
@programatix are you sure this ever worked in Xamarin? We had a similar need and ended up intercepting the request and injecting the headers there. Basically:
Not very elegant but that was the only way it worked on Xamarin. |
@rbakhshi Yes, it works in Xamarin and I have been using it since last year. The sample solution I provided has Xamarin version in it. |
Verified this issue with Visual Studio Enterprise 17.7.0 Preview 2.0. Can repro on iOS and android platform with sample project. |
any update on this i am also facing the same issue |
News about the issue ? |
Issue is still there for .NET 7.0. For .NET 8.0, I can't test it since my macbook doesn't support Ventura.
|
Description
Custom headers set in WebViewHandler are not sent. On my test, both Android and iOS have this issue, so I believe somehow, MAUI subsystem overwritten the headers.
I have prepared a sample solution at https://github.com/programatix/MauiWebViewBug. The test solution provided opens the URL https://manytools.org/http-html-text/http-request-headers which will echo the request headers.
The sample sets the following headers
MAUI result
Xamarin result
I also included the Xamarin sample and the result is correct.
Steps to Reproduce
Link to public reproduction project repository
https://github.com/programatix/MauiWebViewBug
Version with bug
7.0 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android, I was not able test on other platforms
Affected platform versions
Android 13, iOS 16.1.1
Did you find any workaround?
No response
Relevant log output
No response
The text was updated successfully, but these errors were encountered: