d968304570
This is a reland of d84f359786
Original change's description:
> Revert commits part of #40548 which still has some design debates and breaks valid local network http traffic
>
> Bug: https://github.com/flutter/flutter/issues/72723
> Change-Id: Ib5f809fccf1fad69add441fd40c463da8dc8be36
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192953
> Auto-Submit: Xiao Yu <xster@google.com>
> Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
> Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Bug: https://github.com/flutter/flutter/issues/72723
Change-Id: I466d888b3f324a996f0bef0463e7ab3df3179c56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195485
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
Commit-Queue: Xiao Yu <xster@google.com>
33 lines
796 B
Dart
33 lines
796 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.
|
|
|
|
import 'dart:io';
|
|
|
|
import "package:expect/expect.dart";
|
|
|
|
void _checkAllows(List<String> domains) {
|
|
for (final domain in domains) {
|
|
Expect.isTrue(
|
|
isInsecureConnectionAllowed(domain), "$domain should be allowed.");
|
|
}
|
|
}
|
|
|
|
void main() {
|
|
// All domains and addresses are allowed.
|
|
_checkAllows([
|
|
"mailfoobar.com",
|
|
"abc.com",
|
|
"oobar.com",
|
|
"foobar.co",
|
|
"128.221.55.31",
|
|
"fe80::4607:0bff:fea0:7747%invalid",
|
|
"baz.foobar.com",
|
|
"foobar.com",
|
|
"test.baz.foobar.com",
|
|
"test2.test.baz.foobar.com",
|
|
"::1",
|
|
"localhost",
|
|
]);
|
|
}
|