From 621799218a70ddfac4463980d495513eca69fcb5 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Thu, 8 Aug 2024 16:51:22 -0700 Subject: [PATCH 1/5] Fix "unintended_html_in_doc_comment" analysis errors --- pkgs/http/lib/http.dart | 30 +++++++++---------- pkgs/http/lib/src/base_response.dart | 11 +++---- pkgs/http/lib/src/client.dart | 28 ++++++++--------- .../src/compressed_response_body_server.dart | 2 +- .../lib/src/redirect_server.dart | 2 +- .../lib/src/request_headers_server.dart | 2 +- pkgs/http_profile/lib/src/utils.dart | 13 ++++---- 7 files changed, 45 insertions(+), 43 deletions(-) diff --git a/pkgs/http/lib/http.dart b/pkgs/http/lib/http.dart index da35b23a87..317a2c17f3 100644 --- a/pkgs/http/lib/http.dart +++ b/pkgs/http/lib/http.dart @@ -50,15 +50,15 @@ Future get(Uri url, {Map? headers}) => /// Sends an HTTP POST request with the given headers and body to the given URL. /// -/// [body] sets the body of the request. It can be a [String], a [List] or -/// a [Map]. If it's a String, it's encoded using [encoding] and -/// used as the body of the request. The content-type of the request will +/// [body] sets the body of the request. It can be a `String`, a `List` or +/// a `Map`. If it's a `String`, it's encoded using [encoding] +/// and used as the body of the request. The content-type of the request will /// default to "text/plain". /// -/// If [body] is a List, it's used as a list of bytes for the body of the +/// If [body] is a `List`, it's used as a list of bytes for the body of the /// request. /// -/// If [body] is a Map, it's encoded as form fields using [encoding]. The +/// If [body] is a `Map`, it's encoded as form fields using [encoding]. The /// content-type of the request will be set to /// `"application/x-www-form-urlencoded"`; this cannot be overridden. /// @@ -73,15 +73,15 @@ Future post(Uri url, /// Sends an HTTP PUT request with the given headers and body to the given URL. /// -/// [body] sets the body of the request. It can be a [String], a [List] or -/// a [Map]. If it's a String, it's encoded using [encoding] and -/// used as the body of the request. The content-type of the request will +/// [body] sets the body of the request. It can be a `String`, a `List` or +/// a `Map`. If it's a `String`, it's encoded using [encoding] +/// and used as the body of the request. The content-type of the request will /// default to "text/plain". /// -/// If [body] is a List, it's used as a list of bytes for the body of the +/// If [body] is a `List`, it's used as a list of bytes for the body of the /// request. /// -/// If [body] is a Map, it's encoded as form fields using [encoding]. The +/// If [body] is a `Map`, it's encoded as form fields using [encoding]. The /// content-type of the request will be set to /// `"application/x-www-form-urlencoded"`; this cannot be overridden. /// @@ -97,15 +97,15 @@ Future put(Uri url, /// Sends an HTTP PATCH request with the given headers and body to the given /// URL. /// -/// [body] sets the body of the request. It can be a [String], a [List] or -/// a [Map]. If it's a String, it's encoded using [encoding] and -/// used as the body of the request. The content-type of the request will +/// [body] sets the body of the request. It can be a `String`, a `List` or +/// a `Map`. If it's a `String`, it's encoded using [encoding] +/// and used as the body of the request. The content-type of the request will /// default to "text/plain". /// -/// If [body] is a List, it's used as a list of bytes for the body of the +/// If [body] is a `List`, it's used as a list of bytes for the body of the /// request. /// -/// If [body] is a Map, it's encoded as form fields using [encoding]. The +/// If [body] is a `Map`, it's encoded as form fields using [encoding]. The /// content-type of the request will be set to /// `"application/x-www-form-urlencoded"`; this cannot be overridden. /// diff --git a/pkgs/http/lib/src/base_response.dart b/pkgs/http/lib/src/base_response.dart index 0527461dbb..5a076d1f2e 100644 --- a/pkgs/http/lib/src/base_response.dart +++ b/pkgs/http/lib/src/base_response.dart @@ -117,9 +117,9 @@ var _headerSplitter = RegExp(r'[ \t]*,[ \t]*'); /// /// Set-Cookie strings can contain commas. In particular, the following /// productions defined in RFC-6265, section 4.1.1: -/// - e.g. "Expires=Sun, 06 Nov 1994 08:49:37 GMT" -/// - e.g. "Path=somepath," -/// - e.g. "AnyString,Really," +/// - `` e.g. "Expires=Sun, 06 Nov 1994 08:49:37 GMT" +/// - `` e.g. "Path=somepath," +/// - `` e.g. "AnyString,Really," /// /// Some values are ambiguous e.g. /// "Set-Cookie: lang=en; Path=/foo/" @@ -128,8 +128,9 @@ var _headerSplitter = RegExp(r'[ \t]*,[ \t]*'); /// "Set-Cookie: lang=en; Path=/foo/,SID=x23" /// would both be result in `response.headers` => "lang=en; Path=/foo/,SID=x23" /// -/// The idea behind this regex is that ",=" is more likely to -/// start a new then be part of or . +/// The idea behind this regex is that `,=` is more likely to +/// start a new `` then be part of `` or +/// ``. /// /// See https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1 var _setCookieSplitter = RegExp(r'[ \t]*,[ \t]*(?=[' + _tokenChars + r']+=)'); diff --git a/pkgs/http/lib/src/client.dart b/pkgs/http/lib/src/client.dart index 6de5698104..8ee554a241 100644 --- a/pkgs/http/lib/src/client.dart +++ b/pkgs/http/lib/src/client.dart @@ -54,17 +54,17 @@ abstract interface class Client { /// Sends an HTTP POST request with the given headers and body to the given /// URL. /// - /// [body] sets the body of the request. It can be a [String], a [List] - /// or a [Map]. + /// [body] sets the body of the request. It can be a `String`, a `List` + /// or a `Map`. /// - /// If [body] is a String, it's encoded using [encoding] and used as the body - /// of the request. The content-type of the request will default to + /// If [body] is a `String`, it's encoded using [encoding] and used as the + /// body of the request. The content-type of the request will default to /// "text/plain". /// - /// If [body] is a List, it's used as a list of bytes for the body of the + /// If [body] is a `List`, it's used as a list of bytes for the body of the /// request. /// - /// If [body] is a Map, it's encoded as form fields using [encoding]. The + /// If [body] is a `Map`, it's encoded as form fields using [encoding]. The /// content-type of the request will be set to /// `"application/x-www-form-urlencoded"`; this cannot be overridden. /// @@ -77,15 +77,15 @@ abstract interface class Client { /// Sends an HTTP PUT request with the given headers and body to the given /// URL. /// - /// [body] sets the body of the request. It can be a [String], a [List] - /// or a [Map]. If it's a String, it's encoded using + /// [body] sets the body of the request. It can be a `String`, a `List` + /// or a `Map`. If it's a `String`, it's encoded using /// [encoding] and used as the body of the request. The content-type of the /// request will default to "text/plain". /// - /// If [body] is a List, it's used as a list of bytes for the body of the + /// If [body] is a `List`, it's used as a list of bytes for the body of the /// request. /// - /// If [body] is a Map, it's encoded as form fields using [encoding]. The + /// If [body] is a `Map`, it's encoded as form fields using [encoding]. The /// content-type of the request will be set to /// `"application/x-www-form-urlencoded"`; this cannot be overridden. /// @@ -98,15 +98,15 @@ abstract interface class Client { /// Sends an HTTP PATCH request with the given headers and body to the given /// URL. /// - /// [body] sets the body of the request. It can be a [String], a [List] - /// or a [Map]. If it's a String, it's encoded using + /// [body] sets the body of the request. It can be a `String`, a `List` + /// or a `Map`. If it's a `String`, it's encoded using /// [encoding] and used as the body of the request. The content-type of the /// request will default to "text/plain". /// - /// If [body] is a List, it's used as a list of bytes for the body of the + /// If [body] is a `List`, it's used as a list of bytes for the body of the /// request. /// - /// If [body] is a Map, it's encoded as form fields using [encoding]. The + /// If [body] is a `Map`, it's encoded as form fields using [encoding]. The /// content-type of the request will be set to /// `"application/x-www-form-urlencoded"`; this cannot be overridden. /// diff --git a/pkgs/http_client_conformance_tests/lib/src/compressed_response_body_server.dart b/pkgs/http_client_conformance_tests/lib/src/compressed_response_body_server.dart index 17f8897cc8..bb4b95d1e8 100644 --- a/pkgs/http_client_conformance_tests/lib/src/compressed_response_body_server.dart +++ b/pkgs/http_client_conformance_tests/lib/src/compressed_response_body_server.dart @@ -13,7 +13,7 @@ import 'package:stream_channel/stream_channel.dart'; /// On Startup: /// - send port /// On Request Received: -/// - send headers as Map> +/// - send headers as `Map>` /// When Receive Anything: /// - exit void hybridMain(StreamChannel channel) async { diff --git a/pkgs/http_client_conformance_tests/lib/src/redirect_server.dart b/pkgs/http_client_conformance_tests/lib/src/redirect_server.dart index cf1fafddb8..2813e32239 100644 --- a/pkgs/http_client_conformance_tests/lib/src/redirect_server.dart +++ b/pkgs/http_client_conformance_tests/lib/src/redirect_server.dart @@ -18,7 +18,7 @@ import 'package:stream_channel/stream_channel.dart'; /// ".../9" | ".../8" /// ... | ... /// ".../1" | "/" -/// "/" | <200 return> +/// "/" | <200 return> void hybridMain(StreamChannel channel) async { late HttpServer server; diff --git a/pkgs/http_client_conformance_tests/lib/src/request_headers_server.dart b/pkgs/http_client_conformance_tests/lib/src/request_headers_server.dart index c443ad0034..ad3fdfe0cc 100644 --- a/pkgs/http_client_conformance_tests/lib/src/request_headers_server.dart +++ b/pkgs/http_client_conformance_tests/lib/src/request_headers_server.dart @@ -13,7 +13,7 @@ import 'package:stream_channel/stream_channel.dart'; /// On Startup: /// - send port /// On Request Received: -/// - send headers as Map> +/// - send headers as `Map>` /// When Receive Anything: /// - exit void hybridMain(StreamChannel channel) async { diff --git a/pkgs/http_profile/lib/src/utils.dart b/pkgs/http_profile/lib/src/utils.dart index 0225f87f39..f8209bcab4 100644 --- a/pkgs/http_profile/lib/src/utils.dart +++ b/pkgs/http_profile/lib/src/utils.dart @@ -10,13 +10,13 @@ const _tokenChars = r"!#$%&'*+\-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`" /// Splits comma-separated header values. var _headerSplitter = RegExp(r'[ \t]*,[ \t]*'); -/// Splits comma-separated "Set-Cookie" header values. +/// Splits comma-seperated "Set-Cookie" header values. /// /// Set-Cookie strings can contain commas. In particular, the following /// productions defined in RFC-6265, section 4.1.1: -/// - e.g. "Expires=Sun, 06 Nov 1994 08:49:37 GMT" -/// - e.g. "Path=somepath," -/// - e.g. "AnyString,Really," +/// - `` e.g. "Expires=Sun, 06 Nov 1994 08:49:37 GMT" +/// - `` e.g. "Path=somepath," +/// - `` e.g. "AnyString,Really," /// /// Some values are ambiguous e.g. /// "Set-Cookie: lang=en; Path=/foo/" @@ -25,8 +25,9 @@ var _headerSplitter = RegExp(r'[ \t]*,[ \t]*'); /// "Set-Cookie: lang=en; Path=/foo/,SID=x23" /// would both be result in `response.headers` => "lang=en; Path=/foo/,SID=x23" /// -/// The idea behind this regex is that ",=" is more likely to -/// start a new then be part of or . +/// The idea behind this regex is that `,=` is more likely to +/// start a new `` then be part of `` or +/// ``. /// /// See https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1 var _setCookieSplitter = RegExp(r'[ \t]*,[ \t]*(?=[' + _tokenChars + r']+=)'); From 95d939683fe0f8ece12f136e0659fc0c7d12516c Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Fri, 9 Aug 2024 08:25:07 -0700 Subject: [PATCH 2/5] Update pkgs/http/lib/src/base_response.dart Co-authored-by: Anikate De <40452578+Anikate-De@users.noreply.github.com> --- pkgs/http/lib/src/base_response.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/http/lib/src/base_response.dart b/pkgs/http/lib/src/base_response.dart index 5a076d1f2e..39934ceea9 100644 --- a/pkgs/http/lib/src/base_response.dart +++ b/pkgs/http/lib/src/base_response.dart @@ -129,7 +129,7 @@ var _headerSplitter = RegExp(r'[ \t]*,[ \t]*'); /// would both be result in `response.headers` => "lang=en; Path=/foo/,SID=x23" /// /// The idea behind this regex is that `,=` is more likely to -/// start a new `` then be part of `` or +/// start a new `` than be part of `` or /// ``. /// /// See https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1 From 3695311d9098e98d816fa6682214eccf782db9ec Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Fri, 9 Aug 2024 08:26:11 -0700 Subject: [PATCH 3/5] Update pkgs/http_profile/lib/src/utils.dart Co-authored-by: Anikate De <40452578+Anikate-De@users.noreply.github.com> --- pkgs/http_profile/lib/src/utils.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/http_profile/lib/src/utils.dart b/pkgs/http_profile/lib/src/utils.dart index f8209bcab4..aafc4e895a 100644 --- a/pkgs/http_profile/lib/src/utils.dart +++ b/pkgs/http_profile/lib/src/utils.dart @@ -10,7 +10,7 @@ const _tokenChars = r"!#$%&'*+\-.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ^_`" /// Splits comma-separated header values. var _headerSplitter = RegExp(r'[ \t]*,[ \t]*'); -/// Splits comma-seperated "Set-Cookie" header values. +/// Splits comma-separated "Set-Cookie" header values. /// /// Set-Cookie strings can contain commas. In particular, the following /// productions defined in RFC-6265, section 4.1.1: From 928ce6a6301a50331ebc211c173c74d18969c8eb Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Fri, 9 Aug 2024 08:26:18 -0700 Subject: [PATCH 4/5] Update pkgs/http_profile/lib/src/utils.dart Co-authored-by: Anikate De <40452578+Anikate-De@users.noreply.github.com> --- pkgs/http_profile/lib/src/utils.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/http_profile/lib/src/utils.dart b/pkgs/http_profile/lib/src/utils.dart index aafc4e895a..780bb446b8 100644 --- a/pkgs/http_profile/lib/src/utils.dart +++ b/pkgs/http_profile/lib/src/utils.dart @@ -26,7 +26,7 @@ var _headerSplitter = RegExp(r'[ \t]*,[ \t]*'); /// would both be result in `response.headers` => "lang=en; Path=/foo/,SID=x23" /// /// The idea behind this regex is that `,=` is more likely to -/// start a new `` then be part of `` or +/// start a new `` than be part of `` or /// ``. /// /// See https://datatracker.ietf.org/doc/html/rfc6265#section-4.1.1 From 0e1b1a3d2af196efecbfcf220cc507b38d42b8a0 Mon Sep 17 00:00:00 2001 From: Brian Quinlan Date: Tue, 13 Aug 2024 14:33:27 -0700 Subject: [PATCH 5/5] Increment version numbers --- pkgs/http/CHANGELOG.md | 4 ++++ pkgs/http/pubspec.yaml | 2 +- pkgs/http_profile/CHANGELOG.md | 4 ++++ pkgs/http_profile/pubspec.yaml | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/http/CHANGELOG.md b/pkgs/http/CHANGELOG.md index 85dccd7313..18e71333b7 100644 --- a/pkgs/http/CHANGELOG.md +++ b/pkgs/http/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.2.3-wip + +* Fixed unintended HTML tags in doc comments. + ## 1.2.2 * Require package `web: '>=0.5.0 <2.0.0'`. diff --git a/pkgs/http/pubspec.yaml b/pkgs/http/pubspec.yaml index 7039e30838..8c37cff9b1 100644 --- a/pkgs/http/pubspec.yaml +++ b/pkgs/http/pubspec.yaml @@ -1,5 +1,5 @@ name: http -version: 1.2.2 +version: 1.2.3-wip description: A composable, multi-platform, Future-based API for HTTP requests. repository: https://github.com/dart-lang/http/tree/master/pkgs/http diff --git a/pkgs/http_profile/CHANGELOG.md b/pkgs/http_profile/CHANGELOG.md index b9455a4ed6..fdcad42253 100644 --- a/pkgs/http_profile/CHANGELOG.md +++ b/pkgs/http_profile/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.1.1-wip + +* Fixed unintended HTML tags in doc comments. + ## 0.1.0 * Initial **experimental** release. diff --git a/pkgs/http_profile/pubspec.yaml b/pkgs/http_profile/pubspec.yaml index d55dc32260..1184789c8a 100644 --- a/pkgs/http_profile/pubspec.yaml +++ b/pkgs/http_profile/pubspec.yaml @@ -3,7 +3,7 @@ description: >- A library used by HTTP client authors to integrate with the DevTools Network View. repository: https://github.com/dart-lang/http/tree/master/pkgs/http_profile -version: 0.1.0 +version: 0.1.1-wip environment: sdk: ^3.4.0