Overriding headers for a http2 request can cancel the request if mandatory headers are missing
Categories
(Remote Protocol :: WebDriver BiDi, task, P3)
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"] }
- add intercept for string pattern https://www.wikipedia.org in beforeRequestSent
{ phases: ["beforeRequestSent"], urlPatterns: [{ type: "string", pattern: "https://www.wikipedia.org" }] }
- open a tab and load https://www.wikipedia.org
- find the id of the blocked request and
continueRequest
with headers = []
{ 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.
Reporter | ||
Comment 1•5 months ago
|
||
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.
Updated•3 months ago
|
Description
•