dart-sdk/pkg
Jonas Termansen 96cf889e6b [dart:io] Fix HeaderValue parsing, toString(), and support null values.
This is a breaking change. https://github.com/dart-lang/sdk/issues/40709

This change makes the HeaderValue parsing more strict in two invalid
edge cases, supports parameters with null values as a feature, and fixes
toString() so it always produces tokens or quoted-strings valid per RFC
7230 3.2.6.

The empty parameter value without double quotes (which is not allowed by
the standards) is now parsed as the empty string rather than null. E.g.
HeaderValue.parse("v;a=").parameters now gives {"a": ""} rather than
{"a": null}.

Invalid inputs with unbalanced double quotes are now rejected. E.g.
HeaderValue.parse('v;a="b').parameters will now throw a HttpException
instead of giving {"a": "b"}.

The HeaderValue.toString() method now supports parameters with null
values by omitting the value. E.g.:

  HeaderValue("v", {"a": null, "b": "c"}).toString()

now gives

  v; a; b=c

This behavior can be used to implement some features in the Accept and
Sec-WebSocket-Extensions headers.

Likewise the empty value and values using characters outside of RFC 7230
3.2.6 tokens are now correctly implemented by double quoting such values
with escape sequences. E.g.:

  HeaderValue("v",
      {"a": "A", "b": "(B)", "c": "", "d": "ø", "e": "\\\""}).toString()

now gives

   v;a=A;b="(B)";c="";d="ø";e="\\\""

The NNBD migration required making subtle changes to some dart:io
semantics in order to provide a better API. This change backports one of
these semantic changes to the unmigrated SDK so any issues can be
discovered now instead of blocking the future SDK unfork.

Change-Id: Iafc790e03b6290232cac71fe14f995ce0f0b036b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/136620
Commit-Queue: Jonas Termansen <sortie@google.com>
Reviewed-by: Lasse R.H. Nielsen <lrn@google.com>
2020-03-18 11:36:36 +00:00
..
_fe_analyzer_shared Issue 40959. Support null-shorting for cascades. 2020-03-18 07:36:36 +00:00
_js_interop_checks Disallow non-external generative JS constructors 2020-03-06 17:06:39 +00:00
analysis_server Measure how often context type information is available 2020-03-17 23:28:55 +00:00
analysis_server_client Report FLUTTER_GET_WIDGET_DESCRIPTION_CONTENT_MODIFIED when a file is changed during the request. 2020-03-12 01:09:00 +00:00
analysis_tool
analyzer Issue 40959. Support null-shorting for cascades. 2020-03-18 07:36:36 +00:00
analyzer_cli Add the attachment with the content of the file being analyzed. 2020-03-10 04:57:20 +00:00
analyzer_plugin Check for importedLibrary is null in importLibraryElement(). 2020-03-15 21:22:37 +00:00
async_helper Make minitest and async_minitest NNBD agnostic. 2020-03-16 19:58:10 +00:00
build_integration
compiler [dart2js] Normalize X extends Never in generic functions. 2020-03-16 22:03:06 +00:00
dart2js_tools
dart2native pkg/dart2native: make it clear this package is not meant to be published 2020-03-12 17:05:06 +00:00
dart_internal
dartdev Add sanity checks for NNBD state in migration. 2020-03-16 18:27:58 +00:00
dartfix Add sanity checks for NNBD state in migration. 2020-03-16 18:27:58 +00:00
dev_compiler [dart:io] Fix HeaderValue parsing, toString(), and support null values. 2020-03-18 11:36:36 +00:00
diagnostic
expect Make minitest and async_minitest NNBD agnostic. 2020-03-16 19:58:10 +00:00
front_end Add dart2js test directories to the CFE opt-out whitelist. 2020-03-18 08:36:56 +00:00
frontend_server [frontend_server] output dill during initial compilation to JavaScript 2020-03-16 20:34:46 +00:00
js Remove some stale JS interop known differences 2020-02-26 00:52:43 +00:00
js_ast
kernel [cfe] Remove flag --force-nnbd-checks 2020-03-16 15:01:38 +00:00
meta
modular_test
native_stack_traces [vm/compiler] Fix address sizes in DWARF generator. 2020-03-03 12:36:50 +00:00
nnbd_migration Migration: improve specificity of FixBuilderTest.isMakeNullable 2020-03-17 17:19:41 +00:00
smith
sourcemap_testing
status_file
telemetry Allow adding attachments to CrashReportSender.sendReport() 2020-03-04 20:09:16 +00:00
test_runner Remove support for HTML multitests. 2020-03-17 21:04:35 +00:00
testing
vm Re-land "[vm/tfa] Convert named and optional parameters to required parameters where possible." 2020-03-17 19:54:05 +00:00
vm_service [ package:vm_service ] 4.0.0 release, Sentinels are now thrown, Future<dynamic> returns are now Future<Response> 2020-03-05 18:51:29 +00:00
.gitignore
BUILD.gn [BUILD] - Format gn files, this is being done to ensure the unfork CL 2020-03-10 21:56:11 +00:00
pkg.status