mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 05:36:49 +00:00
8d54a30825
For example, this can be used to ban insecure http connections, force use of https ones - see https://github.com/flutter/engine/pull/26226. Issue https://github.com/flutter/flutter/issues/69685 Issue https://github.com/flutter/flutter/issues/54448 Change-Id: Id81aeae9aff0d469ac6f911e4e502b39ce9558bf Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/200524 Commit-Queue: Alexander Aprelev <aam@google.com> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
22 lines
895 B
Dart
22 lines
895 B
Dart
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
part of dart._http;
|
|
|
|
/// Embedder-specific `dart:_http` configuration.
|
|
|
|
/// Embedder hook for intercepting HTTP connections.
|
|
///
|
|
/// The [HttpClient] will call this function as a connection to a given [Uri]
|
|
/// is being established.
|
|
///
|
|
/// The embedder can provide its own implementation to,
|
|
/// for example, confirm whether such a connection should be allowed.
|
|
/// If the connection is not allowed, this method can throw an [Error],
|
|
/// which should then provide enough information to say why the connection
|
|
/// was refused.
|
|
/// If this function returns normally, the connection attempt will proceed.
|
|
@pragma('vm:entry-point')
|
|
void Function(Uri) _httpConnectionHook = (_) {};
|