Open norman93sun opened 1 month ago
👋 @norman93sun
NOTE: This comment is auto-generated.
Are you sure you have already searched for the same problem?
Some people open new issues but they didn't search for something similar or for the same issue. Please, search for it using the GitHub issue search box or on the official inappwebview.dev website, or, also, using Google, StackOverflow, etc. before posting a new one. You may already find an answer to your problem!
If this is really a new issue, then thank you for raising it. I will investigate it and get back to you as soon as possible. Please, make sure you have given me as much context as possible! Also, if you didn't already, post a code example that can replicate this issue.
In the meantime, you can already search for some possible solutions online! Because this plugin uses native WebView, you can search online for the same issue adding android WebView [MY ERROR HERE]
or ios WKWebView [MY ERROR HERE]
keywords.
Following these steps can save you, me, and other people a lot of time, thanks!
Environment
Device information:
Description
Expected behavior: Here I want to use
shouldInterceptAjaxRequest
and change the request url and add header.Current behavior: Only request url be changed, header not working at all.
Steps to reproduce
I submit the source code https://github.com/norman93sun/flutter_inappwebview, you can run the
flutter_inappwebview example
I init webview withinitialData: InAppWebViewInitialData(data: htmlString, baseUrl: WebUri('http://localhost'))
shouldInterceptAjaxRequest:
Step: upload a image by tap browse. The get error.
If I dont InterceptAjaxRequest evrything go right like below:![截屏2024-07-10 15 45 32](https://github.com/pichillilorenzo/flutter_inappwebview/assets/18303855/d04c781b-f4d1-43e4-a243-60e2f73c9c9a)
But got 401 error when I changed the request url, but the authorization header I passed not working.![截屏2024-07-10 15 44 56](https://github.com/pichillilorenzo/flutter_inappwebview/assets/18303855/3c6e2ce5-937c-47b9-ab26-66f98d7f0d72)
I suspect it's a CORS problem, so how to fix this?