Skip to content
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

onHttpError called with a 200 code #414

Open
TristanPct opened this issue May 9, 2019 · 1 comment
Open

onHttpError called with a 200 code #414

TristanPct opened this issue May 9, 2019 · 1 comment

Comments

@TristanPct
Copy link

TristanPct commented May 9, 2019

I'm using this plugin for a payment process (using a bank web interface).
I first load a generated HTML page (given a Uri.dataFromString() with mimeType sets to text/html) that build a form that auto-submit with action field sets to the bank server URL (where you enter your credit card information).

This workflow works fine on Android but I'm having a strange behavior on iOS. Right after the state changed to WebViewState.startLoad (with the bank server URL), onHttpError is triggered with a HTTP 200 code.

I initially quit the webview when an error occur to show a message. So I add a test to avoid false error codes and the web page works fine despite the error.

My app use the latest version (0.3.5).

I would like to know what can cause this behavior, I tried to put breakpoints in Xcode to have more info directly from the WKWebView didFailNavigation (inside FlutterWebviewPlugin.m) but my breakpoint is never hit...

EDIT: Putting the breakpoint in WKWebView decidePolicyForNavigationResponse works.
Reading the code inside this method I noticed that there is no test to determined if the response is effectively an error.

@charafau
Copy link
Collaborator

Hi @TristanPct thanks for report. I will try to fix this issue, but it's probably faster if you'd create PR instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants