Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR follows on from snoyberg/http-client#524, to add support for HTTP 103 Early Hints to the reverse proxy.
The main change here is that we have to switch from WAI's
responseStream
response composer toresponseRaw
, because the nature of early hints means that we don't know the final HTTP status or headers up front, and the raw composer is the only one low-level enough to support sending (potentially multiple) HTTP 103 Early Hints sections before the main response.This is slightly painful, because it
responseStream
would do it.defaultOnExc
changing its signature. This is essentially because we have to stick the early hints callback on the request object before the call toresponseOpen
, and that callback needs to be able to start sending response data beforeresponseOpen
returns. As a result, I had to wrap the entirebracket
call ofwaiProxyToSettings
within thesendResponse
call, which commits us to usingresponseRaw
, which is whydefaultOnExc
has to work this way.