Open ndq2002 opened 1 year ago
@ndq2002 for the most part there shouldn't be a need to enable CORS because there are no web requests going on in typical scenarios. All the resources are static and loaded locally.
Can you show a code example of what you'd like to do, but doesn't work?
We are getting CORs errors when trying to access user information from AWS and when trying to load map data from Google Maps. We implemented a traditional hybrid webview for XF and do not see these errors.
Can you share a snippet about what code is running when the CORS error happens? Is it JS code that is part of the MAUI HybridWebView app doing a fetch()
to an AWS location?
@ndq2002 @mnasers afaik all request are done with 0.0.0.0
domain in header, when using Blazor/Hybrid web view. This can be behind problems you're facing. hth
Hello,
Thanks for the response. I thought I was getting CORs errors due to the AppOrigin being set to 0.0.0.0 but I believe the CORs error I am receiving is due to the JavaScript code trying to call Google Maps directly. I think if we change it so our server makes the call to Google Maps instead, it will resolve the error. There were other resources not loading that I thought were also due to CORs errors but it was because their mime type (.svg) wasn't included in the case statement inside CoreWebView2_WebResourceRequested.
How to enable cors in HybirdWebview?