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

remove boundary characters that pkg:http_parser cannot parse #72

Merged
merged 1 commit into from
Mar 30, 2017

Conversation

yjbanov
Copy link
Contributor

@yjbanov yjbanov commented Mar 29, 2017

Fixes #71

FYI, I'm not familiar with this project's setup. It seems the relevant code is on branch 0.11.x?

/cc @tvolkert @nex3

@yjbanov yjbanov requested a review from kevmoo March 29, 2017 23:44
@@ -85,7 +85,7 @@ Future startServer() {
requestBody = requestBodyBytes;
}

var content = {
var content = <String, dynamic>{
Copy link
Contributor Author

Choose a reason for hiding this comment

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

FYI, the reason for this change was strong mode inferred the map as Map<String, Object> and then complained about expression content['headers'][name] on line 98, saying that Object lacks operator[].

static const List<int> _BOUNDARY_CHARACTERS = const <int>[
39, 43, 95, 44, 45, 46, 58, 61, 63, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
@visibleForTesting
static const List<int> BOUNDARY_CHARACTERS = const <int>[
Copy link
Member

Choose a reason for hiding this comment

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

Better idea

  1. Put this in another file in src
  2. import here
  3. import via lib/src/... in the test
  4. Don't expose another top-level field

I was going to say exclude from 'lib/http.dart' but that's more error prone

Copy link
Member

Choose a reason for hiding this comment

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

...then you don't need pkg/meta either 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@yjbanov yjbanov force-pushed the remove-unparseable-boundary-chars branch from 9021c71 to 604f577 Compare March 29, 2017 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants