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

Merge package:http_parser #1319

Merged
merged 139 commits into from
Oct 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
fc2ccf4
Fix a library name conflict in pkg/http_parser.
nex3 Jun 2, 2014
adacbe1
Move a number of packages and some of pub over to using source_span.
nex3 Jul 23, 2014
aee2082
Update dart:collection to version 1.0.0
lrhn Aug 22, 2014
9be549c
Clean up after r39484 and r39486.
nex3 Aug 26, 2014
50af99e
Add gitignore, status, and codereview files.
nex3 Dec 18, 2014
e64ccb6
Update the pubspec's homepage link.
nex3 Dec 18, 2014
11a3f4a
Fix the status file to match the package bots' expectations.
nex3 Dec 18, 2014
ea96049
Properly skip tests in packages directories.
nex3 Dec 19, 2014
59ce107
Remove initial */s in .status.
nex3 Dec 19, 2014
a732fde
http_parser: update unittest dependency, urls in pubspec and codereview
kevmoo Jan 21, 2015
e9a1bf2
format code, prepare for +6 release
kevmoo Mar 30, 2015
4687b5e
Add more detail to the README.
nex3 Jun 8, 2015
c0a5aba
Upgrade to the new test package.
nex3 Jun 8, 2015
0cd7425
Don't double-close a WebSocket in web_socket_test.
nex3 Jun 9, 2015
a02634b
Bring in latest dart:io WebSocket code.
nex3 Jul 15, 2015
c24d3d2
Use the new test runner on the bots.
nex3 Jul 16, 2015
413f24c
Add an AuthenticationChallenge class.
nex3 Aug 24, 2015
b9a069a
Add a CaseInsensitiveMap class.
nex3 Aug 25, 2015
16149ed
cr
nex3 Aug 25, 2015
56e1468
cr
nex3 Aug 25, 2015
43cec2d
Merge branch 'authentication-challenge' into case-insensitive-map
nex3 Aug 25, 2015
9f7224a
Add an AuthenticationChallenge class.
nex3 Aug 25, 2015
db22041
Merge remote-tracking branch 'origin/master' into authentication-chal…
nex3 Aug 25, 2015
e738185
Merge branch 'authentication-challenge' into case-insensitive-map
nex3 Aug 25, 2015
7160455
Add a CaseInsensitiveMap class.
nex3 Aug 25, 2015
8baf0c2
Merge tag '1.0.0' to master.
whesse Sep 17, 2015
306ef09
Make MediaType case-insensitive, following the spec.
nex3 Oct 19, 2015
b023517
Add a DataUri class.
nex3 Oct 20, 2015
a53a941
Remove DataUri.
nex3 Dec 14, 2015
b3a8581
Get rid of all the library tags.
nex3 Jan 13, 2016
2c4d4cc
Add a WebSocketChannel class.
nex3 Jan 28, 2016
0af1e7b
Release 2.1.0.
nex3 Jan 28, 2016
e2d654f
Deprecate WebSocketChannel.
nex3 Mar 3, 2016
75d8625
Add support for crypto 1.0.0.
nex3 Mar 23, 2016
076e719
Remove deprecated APIs.
nex3 May 5, 2016
4a3d12f
Remove unused libraries.
nex3 May 18, 2016
6cf995c
Remove unnecessary dependencies.
nex3 May 19, 2016
c9bc760
Support string_scanner 1.0.0.
nex3 Jun 20, 2016
8182d4e
Fix duplicate dependency on string_scanner
kevmoo Oct 12, 2016
964da2b
Add a Codec for the chunked transfer coding. (dart-lang/http_parser#8)
nex3 Dec 6, 2016
9275100
Fix chunkedCoding. (dart-lang/http_parser#9)
nex3 Dec 15, 2016
4ecad21
Bump the version to 3.1.1. (dart-lang/http_parser#10)
nex3 Dec 15, 2016
d64470f
Fix strong mode errors in chunked_coding_test
natebosch Apr 10, 2017
caf71e0
Merge pull request dart-lang/http_parser#11 from dart-lang/natebosch_…
natebosch Apr 10, 2017
28ab0ad
rename analysis_options to right name
kevmoo Apr 11, 2017
43fc525
add travis file
kevmoo Apr 11, 2017
3b791a7
dartfmt
kevmoo Apr 11, 2017
784b251
Update comment style generic syntax
keertip Jul 31, 2017
baf17de
format file using 1.25.0-dev.8.0 (dart-lang/http_parser#14)
keertip Jul 31, 2017
7eba0eb
Fix doc comment references
kevmoo Sep 12, 2017
e9ff785
Only test oldest supported and dev + stable
kevmoo Sep 12, 2017
bad13d9
Travis: only test master branch and pull requests
kevmoo Sep 12, 2017
6c7582a
Bump min SDK and update changelog (dart-lang/http_parser#16)
kevmoo Sep 12, 2017
73ac35e
Remove -dev.infinity in SDK upper constraint
kevmoo Sep 19, 2017
40aea36
Stop running tests with Dartium
kevmoo Feb 13, 2018
cdbce46
Release 3.1.2 (dart-lang/http_parser#18)
nex3 May 2, 2018
b4c70ff
Remove upper case constants (dart-lang/http_parser#17)
lrhn May 23, 2018
ff6d612
Update .gitignore to new `dart_tool` pub cache (dart-lang/http_parser…
bcko May 24, 2018
999c2c6
dartfmt
kevmoo Jul 9, 2018
fc17b28
chore: set max SDK version to <3.0.0 (dart-lang/http_parser#22)
chalin Jul 19, 2018
7e8c491
Enable and fix standard lints, test on oldest supported SDK (dart-lan…
kevmoo Apr 30, 2019
016f007
Enable and fix some more standard lints (dart-lang/http_parser#26)
kevmoo Nov 28, 2019
e0599f5
Fix newly enforced package:pedantic lints (dart-lang/http_parser#27)
natebosch Dec 9, 2019
9cc7340
Remove dartlang.org links (dart-lang/http_parser#29)
kevmoo Mar 16, 2020
aef6ee4
Remove lints duplicated in pkg:pednatic
kevmoo Mar 23, 2020
c094d1e
Enable and fix comment references prefer_interpolation lints
kevmoo Mar 23, 2020
0518ae9
lint: enable and fix prefer_final_locals
kevmoo Mar 23, 2020
1ed3c12
Enable and fix some more lints
kevmoo Mar 23, 2020
8906176
Readme: Add badges, update links
kevmoo Mar 24, 2020
0a21bdb
Add an example
kevmoo Mar 24, 2020
ebb6b6a
Prepare to release 3.1.4
kevmoo Mar 24, 2020
081fb35
fix lint that is now better enforced
kevmoo Jun 2, 2020
38fe072
update min SDK to 2.7 (dart-lang/http_parser#32)
kevmoo Jul 7, 2020
819f582
Delete .test_config
kevmoo Jul 29, 2020
a0b01c1
Enable null safety (dart-lang/http_parser#33)
kevmoo Sep 17, 2020
4e28f69
Remove `?` from positional arg in implementation function
kevmoo Sep 17, 2020
bddcf28
Remove null_safety branch from .travis.yml
kevmoo Sep 17, 2020
367e61f
Support latest Dart dev SDK (dart-lang/http_parser#35)
kevmoo Sep 29, 2020
f3870f0
Block publish for now, use major version bump (dart-lang/http_parser#36)
natebosch Oct 1, 2020
31e04ca
Support Dart 2.11
kevmoo Nov 3, 2020
08a8a99
Merge pull request dart-lang/http_parser#37 from dart-lang/bump_sdk
jakemac53 Nov 3, 2020
74d011e
Prepare to publish null-safe version (dart-lang/http_parser#38)
kevmoo Nov 6, 2020
402b540
Migrate to GitHub Actions (dart-lang/http_parser#41)
athomas Feb 1, 2021
45c06f6
stable null safety release (dart-lang/http_parser#42)
jakemac53 Feb 5, 2021
7dd72c6
Remove dependency on `package:charcode`. (dart-lang/http_parser#43)
lrhn Mar 1, 2021
7ebf7ed
Update LICENSE
franklinyow Mar 31, 2021
16b8ec3
Merge pull request dart-lang/http_parser#45 from dart-lang/franklinyo…
franklinyow Mar 31, 2021
302bd37
Fix newly enforced lint (dart-lang/http_parser#46)
kevmoo Apr 26, 2021
51b5d47
Update CI (dart-lang/http_parser#47)
kevmoo Apr 26, 2021
48c2070
Dart format with latest SDK (dart-lang/http_parser#49)
kevmoo Jul 11, 2021
fdd0951
Move from pedantic to lints package (dart-lang/http_parser#50)
natebosch Jul 22, 2021
2877d82
Prepare for publishing 4.0.1
sigurdm Dec 10, 2021
5c5d9d0
Switch from homepage to repository in pubspec (dart-lang/http_parser#54)
devoncarew Apr 20, 2022
b776e54
Update actions (dart-lang/http_parser#55)
kevmoo May 5, 2022
4c61649
Merge pull request dart-lang/http_parser#53 from sigurdm/publish_4_0_1
devoncarew May 16, 2022
9f5a49f
Update README.md
devoncarew May 16, 2022
219439c
Merge pull request dart-lang/http_parser#56 from dart-lang/devoncarew…
devoncarew May 17, 2022
723bb5b
Remove deprecated experimental invariant_booleans lint rule
srawlins Jul 25, 2022
de93548
Merge pull request dart-lang/http_parser#57 from dart-lang/srawlins-p…
srawlins Jul 25, 2022
31f225a
Add permissions to CI script (dart-lang/http_parser#58)
kevmoo Jul 29, 2022
713e60f
Drop pkg:charcode usage in dev_dependencies
kevmoo Aug 1, 2022
57396be
Merge pull request dart-lang/http_parser#59 from dart-lang/drop_pubsp…
devoncarew Aug 1, 2022
1f33656
update CI; prep for publishing
devoncarew Oct 4, 2022
a65240b
Merge pull request dart-lang/http_parser#60 from dart-lang/prep_publish
devoncarew Oct 5, 2022
5618f88
Bump actions/checkout from 3.1.0 to 3.2.0 (dart-lang/http_parser#65)
dependabot[bot] Jan 3, 2023
e791040
Migrate from no-implicit-casts to strict-casts (dart-lang/http_parser…
srawlins Jan 10, 2023
0448e86
Bump dart-lang/setup-dart from 1.3 to 1.4 (dart-lang/http_parser#67)
dependabot[bot] Feb 1, 2023
c421ef0
Bump actions/checkout from 3.2.0 to 3.3.0 (dart-lang/http_parser#68)
dependabot[bot] Feb 1, 2023
c5aa23b
Bump min SDK to 2.17 (dart-lang/http_parser#69)
kevmoo Feb 8, 2023
a8ad724
Bump dart-lang/setup-dart from 1.4.0 to 1.5.0 (dart-lang/http_parser#71)
dependabot[bot] Apr 3, 2023
1d10ca5
Bump actions/checkout from 3.3.0 to 3.5.0 (dart-lang/http_parser#70)
dependabot[bot] Apr 3, 2023
2195e5c
Bump actions/checkout from 3.5.0 to 3.5.2 (dart-lang/http_parser#72)
dependabot[bot] May 8, 2023
23bd5e9
blast_repo fixes (dart-lang/http_parser#73)
devoncarew May 17, 2023
a3a0d35
Require Dart 3.0, update lints (dart-lang/http_parser#74)
kevmoo Jun 7, 2023
7bef32b
Bump actions/checkout from 3.5.2 to 3.5.3 (dart-lang/http_parser#75)
dependabot[bot] Jul 1, 2023
c8e39fb
Bump actions/checkout from 3.5.3 to 3.6.0 (dart-lang/http_parser#77)
dependabot[bot] Sep 2, 2023
7ccbe7a
Bump dart-lang/setup-dart from 1.5.0 to 1.5.1 (dart-lang/http_parser#79)
dependabot[bot] Oct 1, 2023
e7be02a
Bump actions/checkout from 3.6.0 to 4.1.0 (dart-lang/http_parser#78)
dependabot[bot] Oct 2, 2023
9648d65
Bump actions/checkout from 4.1.0 to 4.1.1 (dart-lang/http_parser#81)
dependabot[bot] Nov 1, 2023
0c4555e
Bump dart-lang/setup-dart from 1.5.1 to 1.6.0 (dart-lang/http_parser#80)
dependabot[bot] Nov 2, 2023
245a8dd
drop outdated lints (dart-lang/http_parser#82)
kevmoo Dec 4, 2023
7ebcbd4
Test dart2wasm (dart-lang/http_parser#85)
kevmoo Feb 1, 2024
beb0e62
Bump dart-lang/setup-dart from 1.6.0 to 1.6.2 (dart-lang/http_parser#86)
dependabot[bot] Feb 1, 2024
b0ec7c6
Bump actions/checkout from 4.1.1 to 4.1.2 (dart-lang/http_parser#87)
dependabot[bot] Apr 1, 2024
f8515e5
Bump dart-lang/setup-dart from 1.6.2 to 1.6.4 (dart-lang/http_parser#88)
dependabot[bot] May 1, 2024
062e447
Bump actions/checkout from 4.1.2 to 4.1.4 (dart-lang/http_parser#89)
dependabot[bot] May 2, 2024
3826b21
blast_repo fixes (dart-lang/http_parser#90)
devoncarew May 6, 2024
131903e
Bump actions/checkout from 4.1.4 to 4.1.5 in the github-actions group…
dependabot[bot] May 6, 2024
a63d064
Bump actions/checkout from 4.1.5 to 4.1.6 in the github-actions group…
dependabot[bot] Jun 2, 2024
cb9f4a5
Update min SDK, test wasm on 3.4 (dart-lang/http_parser#97)
kevmoo Jun 10, 2024
d3b2a69
blast_repo fixes (dart-lang/http_parser#98)
kevmoo Jun 10, 2024
0fd1772
`CaseInsensitiveMap`: added constructor `fromEntries`. (dart-lang/htt…
gmpassos Jun 14, 2024
73336b9
Prepare release v4.1.0 (dart-lang/http_parser#100)
kevmoo Jun 17, 2024
86b434a
Bump the github-actions group with 2 updates (dart-lang/http_parser#101)
dependabot[bot] Jul 1, 2024
85d2651
Bump actions/checkout from 4.1.7 to 4.2.0 in the github-actions group…
dependabot[bot] Oct 4, 2024
86e6070
Merge package:http_parser into the http monorepo
mosuem Oct 17, 2024
37b7a19
Add issue template and other fixes
mosuem Oct 17, 2024
ec4cdb0
Moving fixes
mosuem Oct 17, 2024
f1e57b4
Fixes as per review
mosuem Oct 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/http_parser.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
name: "package:http_parser"
about: "Create a bug or file a feature request against package:http_parser."
labels: "package:http_parser"
---
6 changes: 5 additions & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
- changed-files:
- any-glob-to-any-file: 'pkgs/http/**'

'package:http_parser':
- changed-files:
- any-glob-to-any-file: 'pkgs/http_parser/**'

'package:http_client_conformance_tests':
- changed-files:
- any-glob-to-any-file: 'pkgs/http_client_conformance_tests/**'
- any-glob-to-any-file: 'pkgs/http_client_conformance_tests/**'
74 changes: 74 additions & 0 deletions .github/workflows/http_parser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: package:http_parser

on:
push:
branches:
- master
paths:
- '.github/workflows/http_parser.yaml'
- 'pkgs/http_parser/**'
pull_request:
paths:
- '.github/workflows/http_parser.yaml'
- 'pkgs/http_parser/**'
schedule:
- cron: "0 0 * * 0"

env:
PUB_ENVIRONMENT: bot.github

defaults:
run:
working-directory: pkgs/http_parser/

permissions: read-all
mosuem marked this conversation as resolved.
Show resolved Hide resolved

jobs:
# Check code formatting and static analysis on a single OS (linux)
# against Dart dev.
analyze:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [dev]
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
if: always() && steps.install.outcome == 'success'
- name: Analyze code
run: dart analyze --fatal-infos
if: always() && steps.install.outcome == 'success'

test:
needs: analyze
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
sdk: [3.4, dev]
steps:
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
with:
sdk: ${{ matrix.sdk }}
- id: install
name: Install dependencies
run: dart pub get
- name: Run VM tests
run: dart test --platform vm
if: always() && steps.install.outcome == 'success'
- name: Run Chrome tests
run: dart test --platform chrome
if: always() && steps.install.outcome == 'success'
- name: Run Chrome tests - wasm
run: dart test --platform chrome --compiler dart2wasm
if: always() && steps.install.outcome == 'success'
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ and the browser.
| [flutter_http_example](pkgs/flutter_http_example/) | An Flutter app that demonstrates how to configure and use `package:http`. | — |
| [http](pkgs/http/) | A composable, multi-platform, Future-based API for HTTP requests. | [![pub package](https://img.shields.io/pub/v/http.svg)](https://pub.dev/packages/http) |
| [http_client_conformance_tests](pkgs/http_client_conformance_tests/) | A library that tests whether implementations of package:http's `Client` class behave as expected. | |
| [http_parser](pkgs/http_parser/) | A platform-independent package for parsing and serializing HTTP formats. | [![pub package](https://img.shields.io/pub/v/http_parser.svg)](https://pub.dev/packages/http_parser) |
| [http_profile](pkgs/http_profile/) | A library used by HTTP client authors to integrate with the DevTools Network View. | [![pub package](https://img.shields.io/pub/v/http_profile.svg)](https://pub.dev/packages/http_profile) |
| [ok_http](pkgs/ok_http/) | An Android Flutter plugin that provides access to the [OkHttp](https://square.github.io/okhttp/) HTTP client and the OkHttp [WebSocket](https://square.github.io/okhttp/5.x/okhttp/okhttp3/-web-socket/index.html) API. | [![pub package](https://img.shields.io/pub/v/ok_http.svg)](https://pub.dev/packages/ok_http) |
| [web_socket](pkgs/web_socket/) | Any easy-to-use library for communicating with WebSockets that has multiple implementations. | [![pub package](https://img.shields.io/pub/v/web_socket.svg)](https://pub.dev/packages/web_socket) |
Expand Down
4 changes: 4 additions & 0 deletions pkgs/http_parser/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Don’t commit the following directories created by pub.
.dart_tool/
.packages
pubspec.lock
146 changes: 146 additions & 0 deletions pkgs/http_parser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
## 4.1.1

* Move to `dart-lang/http` monorepo.

## 4.1.0

* `CaseInsensitiveMap`: added constructor `fromEntries`.
* Require `package:collection` `^1.19.0`
* Require Dart `^3.4.0`

## 4.0.2

* Remove `package:charcode` from dev_dependencies.

## 4.0.1

* Remove dependency on `package:charcode`.

## 4.0.0

* Stable null safety stable release.

## 4.0.0-nullsafety

* Migrate to null safety.

## 3.1.4

* Fixed lints affecting package health score.
* Added an example.

## 3.1.3

* Set max SDK version to `<3.0.0`, and adjust other dependencies.

## 3.1.2

* Require Dart SDK 2.0.0-dev.17.0 or greater.

* A number of strong-mode fixes.

## 3.1.1

* Fix a logic bug in the `chunkedCoding` codec. It had been producing invalid
output and rejecting valid input.

## 3.1.0

* Add `chunkedCoding`, a `Codec` that supports encoding and decoding the
[chunked transfer coding][].

[chunked transfer coding]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.6.1

## 3.0.2

* Support `string_scanner` 1.0.0.

## 3.0.1

* Remove unnecessary dependencies.

## 3.0.0

* All deprecated APIs have been removed. No new APIs have been added. Packages
that would use 3.0.0 as a lower bound should use 2.2.0 instead—for example,
`http_parser: ">=2.2.0 <4.0.0"`.

* Fix all strong-mode warnings.

## 2.2.1

* Add support for `crypto` 1.0.0.

## 2.2.0

* `WebSocketChannel` has been moved to
[the `web_socket_channel` package][web_socket_channel]. The implementation
here is now deprecated.

[web_socket_channel]: https://pub.dev/packages/web_socket_channel

## 2.1.0

* Added `WebSocketChannel`, an implementation of `StreamChannel` that's backed
by a `WebSocket`.

* Deprecated `CompatibleWebSocket` in favor of `WebSocketChannel`.

## 2.0.0

* Removed the `DataUri` class. It's redundant with the `Uri.data` getter that's
coming in Dart 1.14, and the `DataUri.data` field in particular was an invalid
override of that field.

## 1.1.0

* The MIME spec says that media types and their parameter names are
case-insensitive. Accordingly, `MediaType` now uses a case-insensitive map for
its parameters and its `type` and `subtype` fields are now always lowercase.

## 1.0.0

This is 1.0.0 because the API is stable—there are no breaking changes.

* Added an `AuthenticationChallenge` class for parsing and representing the
value of `WWW-Authenticate` and related headers.

* Added a `CaseInsensitiveMap` class for representing case-insensitive HTTP
values.

## 0.0.2+8

* Bring in the latest `dart:io` WebSocket code.

## 0.0.2+7

* Add more detail to the readme.

## 0.0.2+6

* Updated homepage URL.

## 0.0.2+5

* Widen the version constraint on the `collection` package.

## 0.0.2+4

* Widen the `string_scanner` version constraint.

## 0.0.2+3

* Fix a library name conflict.

## 0.0.2+2

* Fixes for HTTP date formatting.

## 0.0.2+1

* Minor code refactoring.

## 0.0.2

* Added `CompatibleWebSocket`, for platform- and API-independent support for the
WebSocket API.
27 changes: 27 additions & 0 deletions pkgs/http_parser/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Copyright 2014, the Dart project authors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
* Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 changes: 22 additions & 0 deletions pkgs/http_parser/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[![Pub Package](https://img.shields.io/pub/v/http_parser.svg)](https://pub.dartlang.org/packages/http_parser)
[![package publisher](https://img.shields.io/pub/publisher/http_parser.svg)](https://pub.dev/packages/http_parser/publisher)

`http_parser` is a platform-independent package for parsing and serializing
various HTTP-related formats. It's designed to be usable on both the browser and
the server, and thus avoids referencing any types from `dart:io` or `dart:html`.

## Features

* Support for parsing and formatting dates according to [HTTP/1.1][2616], the
HTTP/1.1 standard.

* A `MediaType` class that represents an HTTP media type, as used in `Accept`
and `Content-Type` headers. This class supports both parsing and formatting
media types according to [HTTP/1.1][2616].

* A `WebSocketChannel` class that provides a `StreamChannel` interface for both
the client and server sides of the [WebSocket protocol][6455] independently of
any specific server implementation.

[2616]: https://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html
[6455]: https://tools.ietf.org/html/rfc6455
33 changes: 33 additions & 0 deletions pkgs/http_parser/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# https://dart.dev/tools/analysis#the-analysis-options-file
include: package:dart_flutter_team_lints/analysis_options.yaml

analyzer:
language:
strict-casts: true
strict-inference: true
strict-raw-types: true

linter:
rules:
- avoid_bool_literals_in_conditional_expressions
- avoid_classes_with_only_static_members
- avoid_private_typedef_functions
- avoid_redundant_argument_values
- avoid_returning_this
- avoid_unused_constructor_parameters
- avoid_void_async
- cancel_subscriptions
- join_return_with_assignment
- literal_only_boolean_expressions
- missing_whitespace_between_adjacent_strings
- no_adjacent_strings_in_list
- no_runtimeType_toString
- package_api_docs
- prefer_const_declarations
- prefer_expression_function_bodies
- prefer_final_locals
- unnecessary_await_in_return
- unnecessary_breaks
- use_if_null_to_convert_nulls_to_bools
- use_raw_strings
- use_string_buffers
16 changes: 16 additions & 0 deletions pkgs/http_parser/example/example.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright (c) 2020, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:http_parser/http_parser.dart';

void main() {
final date = DateTime.utc(2014, 9, 9, 9, 9, 9);
print(date); // 2014-09-09 09:09:09.000Z

final httpDateFormatted = formatHttpDate(date);
print(httpDateFormatted); // Tue, 09 Sep 2014 09:09:09 GMT

final nowParsed = parseHttpDate(httpDateFormatted);
print(nowParsed); // 2014-09-09 09:09:09.000Z
}
9 changes: 9 additions & 0 deletions pkgs/http_parser/lib/http_parser.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

export 'src/authentication_challenge.dart';
export 'src/case_insensitive_map.dart';
export 'src/chunked_coding.dart';
export 'src/http_date.dart';
export 'src/media_type.dart';
Loading
Loading