Skip to content

Conversation

@mehmetf
Copy link
Contributor

@mehmetf mehmetf commented Apr 11, 2020

Description

This is being submitted in preparation of breaking change described in dart-lang/sdk#40548.

The Dart SDK support for this is added dart-lang/sdk@74a20b7.

Following this PR, I will draft and send out an announcement for flutter-announce@. Afterwards, I will submit the change to engine to ban HTTP by default on iOS and Android.

Related Issues

#54448

Tests

I added the following tests:

  • Make sure the symbol being used actually throws a [StateError] when HTTP protocol is used.
  • Make sure we are setting the right value in the zone variables via allowHttp.

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

  • No, no existing tests failed, so this is not a breaking change.
  • Yes, this is a breaking change.

@fluttergithubbot fluttergithubbot added framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Apr 11, 2020
@mehmetf mehmetf requested a review from yjbanov April 11, 2020 16:16
@mehmetf
Copy link
Contributor Author

mehmetf commented Apr 11, 2020

@yjbanov please take a look. I tried not to add this test to Web blacklist but I am not sure of the proper way to write tests that should cover both Web and non-web. Is this the pattern to follow? Thanks.

Copy link
Contributor

@yjbanov yjbanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with a bunch of nitpicking.

/// Best Practices:
/// - Do not wrap your entire app with [allowHttp]. Wrap *exactly* what you need and nothing more.
/// - Avoid libraries that require accessing HTTP URLs.
T allowHttp<T>(T action()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this sound less benign? Perhaps allowUnsecureHttp?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think allowHttp is better. It is more consistent with the rest of the platform code and as an API it is less confusing imo (is there a secure http?).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, https :)

@fluttergithubbot fluttergithubbot merged commit d1e0528 into flutter:master Apr 13, 2020
mehmetf added a commit that referenced this pull request Apr 14, 2020
mehmetf added a commit that referenced this pull request Apr 14, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

c: contributor-productivity Team-specific productivity, code health, technical debt. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants