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

Content-Range header parsing #153

Open
annevk opened this issue Jan 22, 2021 · 2 comments
Open

Content-Range header parsing #153

annevk opened this issue Jan 22, 2021 · 2 comments
Assignees

Comments

@annevk
Copy link

annevk commented Jan 22, 2021

I looked at https://wicg.github.io/background-fetch/#extract-content-range-values and one problem I found is that this will lead to different results between

Content-Range: x, y

and

Content-Range: x
Content-Range: y

which is something we should avoid (with the notable exception of Set-Cookie). Please use https://fetch.spec.whatwg.org/#concept-header-list-get to get the value instead.

The implications for this algorithm are that either you need to handle values containing , in a special way or you let them be treated as errors. Not sure what matches implementations better.

The outcome here might also impact annevk/orb#16 as that has rather lax header checking.

(I suspect we might also want to move this into Fetch if this is to be shared between this, media elements, and ORB.)

@jakearchibald
Copy link
Collaborator

I should just be able to switch to https://fetch.spec.whatwg.org/#concept-header-list-get, and step 3 will still do the right validation.

@jakearchibald jakearchibald self-assigned this Jan 22, 2021
@annevk
Copy link
Author

annevk commented Jan 22, 2021

Yeah, though the second example above might pass today (for a correct x) and would no longer after that change. Worth testing as implementations are buggy around stuff like this.

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