Skip to content

Commit 73336b9

Browse files
authored
Prepare release v4.1.0 (dart-archive/http_parser#100)
* Also make private _State class an enum * minor bump with new features
1 parent 0fd1772 commit 73336b9

File tree

4 files changed

+19
-21
lines changed

4 files changed

+19
-21
lines changed

pkgs/http_parser/CHANGELOG.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
## 4.0.3-wip
1+
## 4.1.0
22

33
* `CaseInsensitiveMap`: added constructor `fromEntries`.
4-
5-
* Require Dart 3.4
6-
7-
* collection: ^1.19.0
4+
* Require `package:collection` `^1.19.0`
5+
* Require Dart `^3.4.0`
86

97
## 4.0.2
108

pkgs/http_parser/analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# https://dart.dev/guides/language/analysis-options
1+
# https://dart.dev/tools/analysis#the-analysis-options-file
22
include: package:dart_flutter_team_lints/analysis_options.yaml
33

44
analyzer:

pkgs/http_parser/lib/src/chunked_coding/decoder.dart

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -173,63 +173,63 @@ class _Sink extends ByteConversionSinkBase {
173173

174174
/// An enumeration of states that [_Sink] can exist in when decoded a chunked
175175
/// message.
176-
class _State {
176+
enum _State {
177177
/// The parser has fully parsed one chunk and is expecting the header for the
178178
/// next chunk.
179179
///
180180
/// Transitions to [size].
181-
static const boundary = _State._('boundary');
181+
boundary('boundary'),
182182

183183
/// The parser has parsed at least one digit of the chunk size header, but has
184184
/// not yet parsed the `CR LF` sequence that indicates the end of that header.
185185
///
186186
/// Transitions to [sizeBeforeLF].
187-
static const size = _State._('size');
187+
size('size'),
188188

189189
/// The parser has parsed the chunk size header and the CR character after it,
190190
/// but not the LF.
191191
///
192192
/// Transitions to [body] or [bodyBeforeCR].
193-
static const sizeBeforeLF = _State._('size before LF');
193+
sizeBeforeLF('size before LF'),
194194

195195
/// The parser has parsed a chunk header and possibly some of the body, but
196196
/// still needs to consume more bytes.
197197
///
198198
/// Transitions to [bodyBeforeCR].
199-
static const body = _State._('body');
199+
body('body'),
200200

201201
// The parser has parsed all the bytes in a chunk body but not the CR LF
202202
// sequence that follows it.
203203
//
204204
// Transitions to [bodyBeforeLF].
205-
static const bodyBeforeCR = _State._('body before CR');
205+
bodyBeforeCR('body before CR'),
206206

207207
// The parser has parsed all the bytes in a chunk body and the CR that follows
208208
// it, but not the LF after that.
209209
//
210-
// Transitions to [bounday].
211-
static const bodyBeforeLF = _State._('body before LF');
210+
// Transitions to [boundary].
211+
bodyBeforeLF('body before LF'),
212212

213213
/// The parser has parsed the final empty chunk but not the CR LF sequence
214214
/// that follows it.
215215
///
216216
/// Transitions to [endBeforeLF].
217-
static const endBeforeCR = _State._('end before CR');
217+
endBeforeCR('end before CR'),
218218

219219
/// The parser has parsed the final empty chunk and the CR that follows it,
220220
/// but not the LF after that.
221221
///
222222
/// Transitions to [end].
223-
static const endBeforeLF = _State._('end before LF');
223+
endBeforeLF('end before LF'),
224224

225225
/// The parser has parsed the final empty chunk as well as the CR LF that
226226
/// follows, and expects no more data.
227-
static const end = _State._('end');
227+
end('end');
228228

229-
final String _name;
229+
const _State(this.name);
230230

231-
const _State._(this._name);
231+
final String name;
232232

233233
@override
234-
String toString() => _name;
234+
String toString() => name;
235235
}

pkgs/http_parser/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: http_parser
2-
version: 4.0.3-wip
2+
version: 4.1.0
33
description: >-
44
A platform-independent package for parsing and serializing HTTP formats.
55
repository: https://github.com/dart-lang/http_parser

0 commit comments

Comments
 (0)