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

Ambiguity in spec around how much of body is parsed as JS/JSON #21

Closed
MattMenke2 opened this issue Feb 22, 2021 · 2 comments
Closed

Ambiguity in spec around how much of body is parsed as JS/JSON #21

MattMenke2 opened this issue Feb 22, 2021 · 2 comments

Comments

@MattMenke2
Copy link

Step 5 says "Wait for 1024 bytes of response or end-of-file, whichever comes first and let bytes be those bytes."

Step 12 says "If response's body parses as JavaScript and does not parse as JSON, then return true."

I assume the algorithm is supposed to wait for the full body, which is then parsed as JS/JSON, as opposed to using some sort of partial parser, but it's never mentioned.

So, it seems to me either:

  1. Mentioning body bytes implicitly assumes we have waited for those bytes, and the "Wait for" in step 5 is unnecessary, or
  2. we should mention waiting for the entire body in 12 or in a step before 12.

I'd prefer 2), to make it explicit that we need to wait for the entire body, presumably just before or in step 12.

@annevk
Copy link
Owner

annevk commented Feb 22, 2021

Yeah, this should do the same as whatwg/fetch#1172 implements for integrity checking. Consuming the entire body and if successful and the check is successful creating a new body with the read bytes.

@annevk
Copy link
Owner

annevk commented Oct 4, 2021

This is a duplicate of #2.

@annevk annevk closed this as completed Oct 4, 2021
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

No branches or pull requests

2 participants