Open Bug 1904317 Opened 5 months ago Updated 2 months ago

Overriding headers for a http2 request can cancel the request if mandatory headers are missing

Categories

(Remote Protocol :: WebDriver BiDi, task, P3)

task

Tracking

(Not tracked)

People

(Reporter: jdescottes, Unassigned)

References

()

Details

(Whiteboard: [webdriver:backlog])

The network.continueRequest command will override all existing request headers when providing a headers parameter.
However, for some protocols eg http2, if the request is missing some headers, it will not succeed.

Clients should rather merge or update existing request headers with the custom ones they want to use, but it would be great if we could warn them when they are submitting a request which is likely to fail due to missing headers.

STRs:

  • start bidi session
  • subscribe to network events

{ events: ["network"] }

{ phases: ["beforeRequestSent"], urlPatterns: [{ type: "string", pattern: "https://www.wikipedia.org" }] }

{ request: "19", headers: []}

The request will fail, and you will receive a fetchError event (with errorText=NS_ERROR_NET_RESET). However the continueRequest command itself was successful and it can be difficult for users to realize that the sent request was missing some mandatory headers.

The exact symptoms can probably vary depending on the protocol used, but in any case the load will not be successful.

See Also: → 1830875

Summary: we should file an issue on Github and check the cross browser situation here. Eg make sure that all browsers are handling this similarly.
We might want to include some mandatory headers by default if we see they are missing.

Finally there should be support for h2 on wpt tests, via a h2 prefix to be added to the tests, so we should try to use that in order to write a test case for it.

Priority: -- → P3
Whiteboard: [webdriver:backlog]
You need to log in before you can comment on or make changes to this bug.