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

Issue on intercepting ajax request #269

Closed
ariefaprilianto opened this issue Jan 23, 2020 · 3 comments
Closed

Issue on intercepting ajax request #269

ariefaprilianto opened this issue Jan 23, 2020 · 3 comments

Comments

@ariefaprilianto
Copy link

ariefaprilianto commented Jan 23, 2020

I got problem intercepting ajax request when adding some additional header. If I remove the header addition, request would be continued, otherwise request was stopped.

[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.35.0)

flutter_inappwebview: ^2.1.0+1

android: AndroidInAppWebViewOptions(
    domStorageEnabled: true,
    databaseEnabled: true,
    clearSessionCache: false,
),
crossPlatform: InAppWebViewOptions(
    userAgent: DotEnv().env['DEFAULT_UA'],
    debuggingEnabled: true,
    javaScriptCanOpenWindowsAutomatically: true,
    preferredContentMode: InAppWebViewUserPreferredContentMode.MOBILE,
    useShouldInterceptAjaxRequest: true,
    useShouldInterceptFetchRequest: true,
)
...
shouldInterceptAjaxRequest: (InAppWebViewController controller, AjaxRequest ajaxReq) async {
    print("ajaxReq.url: ${ajaxReq.url}");
    
    ajaxReq.headers.setRequestHeader("someheader", "somevalue");
    
    return ajaxReq;
},
@ariefaprilianto
Copy link
Author

It's solved. Actually it just get blocked by CORS policy at the preflight.

This was referenced Jul 6, 2020
@norman93sun
Copy link

It's solved. Actually it just get blocked by CORS policy at the preflight.

Hi there,
Could you tell me how to fix this?

Copy link

github-actions bot commented Oct 3, 2024

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants