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

error miss caused by splitting whenComplete instead of inline http_certificate_pinning/lib/src/dio/certificate_pinning_interceptor.dart #26

Closed
BVCobyAmar opened this issue Mar 1, 2022 · 1 comment

Comments

@BVCobyAmar
Copy link

BVCobyAmar commented Mar 1, 2022

This issue is easy to fix and can help solve problems with missed errors. The issue is that because of adding the whenComplete function to the secure param instead of chaining it inline.
Here is an example of my fix:
String resp = '';

secure = HttpCertificatePinning.check(
        serverURL: options.baseUrl,
        headerHttp: options.headers.map((a, b) => MapEntry(a, b.toString())),
        sha: SHA.SHA256,
        allowedSHAFingerprints: _allowedSHAFingerprints,
        timeout: _timeout,
      ).whenComplete(() => secure = null);
@BVCobyAmar BVCobyAmar changed the title missing try catch in check function lib/src/http_certificate_pinning.dart error miss caused by splitting whenComplete instead of inline http_certificate_pinning/lib/src/dio/certificate_pinning_interceptor.dart Mar 1, 2022
@diefferson
Copy link
Owner

@BVCobyAmar Could you give more details about how can I reproduce this issue?

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

No branches or pull requests

2 participants