Skip to content

cupertino_http v3.2.0

Latest

Choose a tag to compare

@brianquinlan brianquinlan released this 30 Nov 18:21
· 1 commit to master since this release
3fc4c67

3.2.0

  • Add support for handling authentication challenges, such as TLS server
    trust evaluation:

    • Add an onChallenge callback to URLSession.sessionWithConfiguration,
      URLSession.delegate and URLSessionTask.delegate.
    • Add URLAuthenticationChallenge, URLProtectionSpace, URLCredential,
      SecTrust, SecCertificate and the NSURLAuthenticationMethod...
      constants (e.g. NSURLAuthenticationMethodServerTrust).
  • Add an onChallenge parameter to CupertinoClient.fromSessionConfiguration,
    which makes it possible to trust servers using self-signed certificates or
    certificates issued by a private certificate authority, or to implement
    certificate pinning.

  • Add URLRequest.assumesHTTP3Capable and
    MutableURLRequest.assumesHTTP3Capable.

  • Add OnMetrics, the onMetrics argument of
    URLSession.sessionWithConfiguration, and URLSessionTaskMetrics /
    URLSessionTaskTransactionMetrics, so the protocol negotiated for a request
    (h2, h3, http/1.1) can be read with
    URLSessionTaskTransactionMetrics.networkProtocolName.

  • Add an onMetrics parameter to CupertinoClient.fromSessionConfiguration,
    which makes the URLSessionTaskMetrics of each request available together
    with the request, e.g. the negotiated protocol (h2, h3, http/1.1) and
    whether the connection was reused.

  • Update package description and declare supported platforms (ios, macos).

  • Fix a memory leak when the abortTrigger for an Abortable is retained
    past the completion of the response. For example:

    final abortTrigger = Completer<void>();
    // The timer will keep `abortTrigger` alive until it fires in 60 seconds,
    // even if the response completes before then.
    Timer(const Duration(seconds: 60), abortTrigger.complete);
    final request = http.AbortableRequest(
      'GET',
      Uri.https('example.com'),
      abortTrigger: abortTrigger.future,
    );
    final response = await client.send(request);
    await response.stream.drain<void>();