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

Revamp body's total bytes as length #1184

Merged
merged 2 commits into from
Mar 10, 2021
Merged

Revamp body's total bytes as length #1184

merged 2 commits into from
Mar 10, 2021

Conversation

annevk
Copy link
Member

@annevk annevk commented Mar 1, 2021

Together with #1183 this solves the Fetch side of #604. Changes:

  • No longer set a length for network responses. Callers will have to parse Content-Length themselves.
  • Make extract set length so requests will set Content-Length correctly.

XMLHttpRequest PR: whatwg/xhr#317.

Tests: web-platform-tests/wpt#27837.


Preview | Diff

annevk added 2 commits March 1, 2021 17:42
Together with #1183 this solves the Fetch side of #604. Changes:

* No longer set a length for network responses. Callers will have to parse Content-Length themselves.
* Make extract set length so requests will set Content-Length correctly.

XMLHttpRequest PR: TODO.

Tests: web-platform-tests/wpt#27837.
annevk added a commit to whatwg/xhr that referenced this pull request Mar 2, 2021
The only information browsers use for progress events for responses is the Content-Length header.

Align on that and only use body's length concept for uploads.

Tests: web-platform-tests/wpt#27837.

Fetch PRs: whatwg/fetch#1183 & whatwg/fetch#1184.
annevk added a commit to whatwg/xhr that referenced this pull request Mar 2, 2021
The only information browsers use for progress events for responses is the Content-Length header.

Align on that and only use body's length concept for uploads.

Tests: web-platform-tests/wpt#27837.

Fetch PRs: whatwg/fetch#1183 & whatwg/fetch#1184.
@annevk
Copy link
Member Author

annevk commented Mar 2, 2021

This seems ready for review, as well as the tests and the XHR side of things. The idea is that we use body's length concept for uploads and it will be set through extract, and that for downloads we just look at the Content-Length header. This seems to match browsers and makes some amount of sense.

@annevk annevk mentioned this pull request Mar 3, 2021
3 tasks
annevk added a commit to whatwg/xhr that referenced this pull request Mar 3, 2021
The only information browsers use for progress events for responses is the Content-Length header.

Align on that and only use body's length concept for uploads.

Tests: web-platform-tests/wpt#27837.

Fetch PRs: whatwg/fetch#1183 & whatwg/fetch#1184.
annevk added a commit to web-platform-tests/wpt that referenced this pull request Mar 10, 2021
Some tests with progress events, Content-Length, and service workers.

For whatwg/fetch#604, whatwg/fetch#1184, and whatwg/xhr#317.
@annevk annevk merged commit f0ae5a6 into main Mar 10, 2021
@annevk annevk deleted the annevk/content-length branch March 10, 2021 11:09
annevk added a commit to whatwg/xhr that referenced this pull request Mar 11, 2021
The only information browsers use for progress events for responses is the Content-Length header.

Align on that and only use body's length concept for uploads.

Tests: web-platform-tests/wpt#27837.

Fetch PRs: whatwg/fetch#1183 & whatwg/fetch#1184.

Closes whatwg/fetch#604.
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Mar 19, 2021
…testonly

Automatic update from web-platform-tests
XMLHttpRequest: Content-Length tests

Some tests with progress events, Content-Length, and service workers.

For whatwg/fetch#604, whatwg/fetch#1184, and whatwg/xhr#317.
--

wpt-commits: 0adf967c6d70747d3f77573a7f7f2353d82142c1
wpt-pr: 27837
Bishwarupjee pushed a commit to Bishwarupjee/xhr that referenced this pull request Jan 31, 2024
The only information browsers use for progress events for responses is the Content-Length header.

Align on that and only use body's length concept for uploads.

Tests: web-platform-tests/wpt#27837.

Fetch PRs: whatwg/fetch#1183 & whatwg/fetch#1184.

Closes whatwg/fetch#604.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants