Skip to content

Conversation

@jan-ivar
Copy link
Member

@jan-ivar jan-ivar commented Dec 15, 2025

Fixes #263.


Preview | Diff

@jan-ivar
Copy link
Member Author

Meeting:

  • @vasilvv check with people on the PR details

@jan-ivar
Copy link
Member Author

Also cc @annevk to make sure we've not missed anything.

Comment on lines +1221 to +1223
:: Once a [=WebTransport session=] has been established, holds the application-level
headers set by the server, if any. Initially null.
The getter steps are to return [=this=]'s {{[[Headers]]}}.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be clearer if we added some text indicating that these headers are subject to the forbidden request-header list as defined by https://fetch.spec.whatwg.org/#methods section 2.2.2?


<div algorithm="process a WebTransport fetch response">
To <dfn>process a WebTransport fetch response</dfn>, given a |response|, and |congestionControl|, run these steps:
To <dfn>process a WebTransport fetch response</dfn>, given a |response| and |transport|, run these steps:
Copy link
Member

Choose a reason for hiding this comment

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

Nit: consider specifying the types of the arguments here.

1. Set |transport|.{{[[State]]}} to `"connected"`.
1. Set |transport|.{{[[Session]]}} to |session|.
1. Let |headers| be a copy of |response|’s [=response/header list=].
1. Remove from |headers| each header whose name is a [=byte-case-insensitive=] match for `WT-Protocol`.
Copy link
Member

Choose a reason for hiding this comment

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

the application will receive the number of streams it anticipates.

: <dfn for="WebTransport" attribute>headers</dfn>
:: Once a [=WebTransport session=] has been established, holds the application-level
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
:: Once a [=WebTransport session=] has been established, holds the application-level
:: Once a [=WebTransport session=] has been established, it holds the application-level

?

Comment on lines +990 to +996
1. Let |headers| be {{WebTransport/constructor(url, options)/options}}["{{WebTransportOptions/headers}}"].
1. If |headers| is a not a {{Headers}} object, then set |headers| to a new {{Headers}}
object [=Headers/filled=] with
{{WebTransport/constructor(url, options)/options}}["{{WebTransportOptions/headers}}"].
1. Set |request|'s [=request/header list=] to a copy of |headers|'s [=Headers/header list=].
1. If |request|'s [=request/header list=] [=header list/contains=] `WT-Available-Protocols`, then
throw a {{TypeError}}.
Copy link
Member

Choose a reason for hiding this comment

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

It seems you are not validating the Headers object and just copy all its headers straight onto request. Are you sure that's what you want? @wilaw's comment below suggests you are expecting some kind of validation at least.

This is why the Request constructor for instance creates its own instance always and then attempts to forward the headers (which might end up throwing).

Perhaps we could/should create some kind of abstraction for this which can be shared by Fetch and WebTransport.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! We definitely want filtering by the forbidden request header list

: <dfn for="WebTransport" attribute>headers</dfn>
:: Once a [=WebTransport session=] has been established, holds the application-level
headers set by the server, if any. Initially null.
The getter steps are to return [=this=]'s {{[[Headers]]}}.
Copy link
Member

Choose a reason for hiding this comment

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

This is a little hand-wavy. Shouldn't you define somewhere a slot that holds null or a Headers object?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Oh sorry, I missed [[ and ]] and thought this was referring to the object.

@jan-ivar
Copy link
Member Author

@vasilvv did you get any feedback from people on this PR?

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.

Do we want to allow web developers to add headers of the CONNECT request?

3 participants