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

Let Fetch be in charge of extracting the bytes #97

Merged
merged 3 commits into from
Feb 22, 2021
Merged

Let Fetch be in charge of extracting the bytes #97

merged 3 commits into from
Feb 22, 2021

Conversation

annevk
Copy link
Member

@annevk annevk commented Feb 19, 2021

Corresponding Fetch PR: whatwg/fetch#1172.

Closes #63. Helps with #83.


Preview | Diff

@annevk
Copy link
Member Author

annevk commented Feb 19, 2021

This needs to be merged before the Fetch PR and Shepherd needs to index https://github.com/w3c/webappsec-subresource-integrity/ if it doesn't already (cc @tabatkins).

Note that this results in some nonsensical fragment identifiers, but I think that's better than breaking them.

index.bs Show resolved Hide resolved
@annevk annevk requested a review from mozfreddyb February 19, 2021 15:22
annevk added a commit to whatwg/fetch that referenced this pull request Feb 20, 2021
This refactoring allows specifications building on top of Fetch to
avoid having to directly integrate with Streams. It makes these
changes:

* body's transmitted bytes is removed. body's total bytes will likely
  be removed in #604.
* body's done and wait concepts are removed.
* It introduces three primitives to read a body: incrementally read
  (process each chunk), fully read (get all), and
  fully reading body as promise (get all as promise).
* Removed transmit request body in favor of HTTP-network fetch using
  incrementally read directly to transmit the request body.
* Fetch's processRequestBody and processRequestEndOfBody are no longer
  passed a request. The former is passed the chunk length for progress
  reporting. (Needed by XMLHttpRequest.)
* Fetch's processResponseEndOfBody when passed will now cause the body
  to be fully read and will pass the result in the second argument.
  (This means that callers can no longer read the body themselves.)
* Subresource Integrity changed slightly with Fetch handing it the
  bytes and integrity metadata and no longer a response. Essentially
  fetch fully reads the body, does the check, and then creates a new
  body from the same bytes to hand to the caller.

Subresoruce Integrity PR: w3c/webappsec-subresource-integrity#97.

XMLHttpRequest PR: whatwg/xhr#313.

Closes #661.
Copy link
Collaborator

@mozfreddyb mozfreddyb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This is much better :)

@annevk annevk merged commit afa3d6a into main Feb 22, 2021
@annevk annevk deleted the annevk/fetch branch February 22, 2021 12:46
annevk added a commit to whatwg/fetch that referenced this pull request Feb 24, 2021
This refactoring allows specifications building on top of Fetch to
avoid having to directly integrate with Streams. It makes these
changes:

* body's transmitted bytes is removed. body's total bytes will likely
  be removed in #604.
* body's done and wait concepts are removed.
* It introduces three primitives to read a body: incrementally read
  (process each chunk), fully read (get all), and
  fully reading body as promise (get all as promise).
* Removed transmit request body in favor of HTTP-network fetch using
  incrementally read directly to transmit the request body.
* Fetch's processRequestBody and processRequestEndOfBody are no longer
  passed a request. The former is passed the chunk length for progress
  reporting. (Needed by XMLHttpRequest.)
* Fetch's processResponseEndOfBody when passed will now cause the body
  to be fully read and will pass the result in the second argument.
  (This means that callers can no longer read the body themselves.)
* Subresource Integrity changed slightly with Fetch handing it the
  bytes and integrity metadata and no longer a response. Essentially
  fetch fully reads the body, does the check, and then creates a new
  body from the same bytes to hand to the caller.

Subresoruce Integrity PR: w3c/webappsec-subresource-integrity#97.

XMLHttpRequest PR: whatwg/xhr#313.

Closes #661.
annevk added a commit to whatwg/fetch that referenced this pull request Feb 24, 2021
This refactoring allows specifications building on top of Fetch to
avoid having to directly integrate with Streams. It makes these
changes:

* body's transmitted bytes is removed. body's total bytes will likely
  be removed in #604.
* body's done and wait concepts are removed.
* It introduces three primitives to read a body: incrementally read
  (process each chunk), fully read (get all), and
  fully reading body as promise (get all as promise).
* Removed transmit request body in favor of HTTP-network fetch using
  incrementally read directly to transmit the request body.
* Fetch's processRequestBody and processRequestEndOfBody are no longer
  passed a request. The former is passed the chunk length for progress
  reporting. (Needed by XMLHttpRequest.)
* Fetch's processResponseEndOfBody when passed will now cause the body
  to be fully read and will pass the result in the second argument.
  (This means that callers can no longer read the body themselves.)
* Subresource Integrity changed slightly with Fetch handing it the
  bytes and integrity metadata, and no longer a response. Essentially
  fetch fully reads the body, does the check, and then creates a new
  body from the same bytes to hand to the caller.

Subresoruce Integrity PR: w3c/webappsec-subresource-integrity#97.

XMLHttpRequest PR: whatwg/xhr#313.

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

Successfully merging this pull request may close these issues.

"Apply algorithm to response" is recursive with no base case
2 participants