wpt
wpt copied to clipboard
Handling of multiple responses
Originally posted as https://github.com/w3c/wptserve/issues/117 by @annevk on 05 Apr 2017, 08:11 UTC:
If we want to test 1xx responses, we need to be able to respond with one, and then follow up with another or a final non-1xx response.
@annevk, can you elaborate on what's needed here? Which tests can't be written because this is missing?
Basically ensuring that everything that does a fetch does not do bad things if the scenario in OP happens. But also testing https://tools.ietf.org/html/draft-ietf-httpbis-early-hints I suppose if browsers implement that (Chrome might).
Would that require some changes to wptserve? I think there's already a way to send a raw response and to save state across requests.
@foolip I'm not sure why you'd need to save state here? I think I tried raw responses, but it's been ages.
If raw responses are all that's needed, then probably this already works then. Can you change the labels to the specs that need this, and send back to infra if it doesn't work?
I'm investigating fetchpriority in Link headers for early hints in Mozilla's bug 1882084 and also could not find in the wpt doc how to send multiple headers (more specifically 1xx informational response, followed by 2xx successful response).
@foolip: What do you mean by raw responses? Using .asis files?
I just found https://github.com/web-platform-tests/wpt/commits/master/loading/early-hints which has tests for early hints.
@fred-wang .asis files is indeed what I meant. That's not used in loading/early-hints/ however, so I guess there's another way?
@foolip Right, it seems they are just using response.writer.write_raw_header_frame to write a raw 103 response in early-hints-test-loader.h2.py so I can do the same with fetchpriority (I had started https://phabricator.services.mozilla.com/D209632 but have been focusing on something else so haven't really tried yet).