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 started with me wading into the
/drip
endpoint to addServer-Timing
trailers as suggested in #72.In making those changes, I discovered that the standard golang net/http server we're building on only supports sending trailers when the response is written using
Content-Encoding: chunked
. Initially, I thought it would be reasonable for this endpoint, which is designed to stream writes to the client, to switch over to a chunked response, but upon further consideration I don't think that's a good idea. So I'll defer adding trailers to some later work.But, in thinking this through (and fighting with the unit tests already in place for drip), I realized that the
/drip
endpoint had room for improvement, if we think about it as an endpoint designed to let clients test their behavior when an HTTP server is responding very slowly.So, we ended up with these changes:
/drip
would immediately write the desired status code and then wait for the initial delay (if any).Worth noting that I now believe it's important that this endpoint not switch over to chunked content encoding, because it is useful to maintain and endpoint that simulates a server very slowly writing a "normal" HTTP response.
I'll consider adding trailers to an existing chunked endpoint, or potentially add a new, explicitly chunked endpoint to exercise that functionality.