felixge/httpsnoop

Support 1xx headers

Closed this issue · 2 comments

mitar commented

Go 1.19 gained support for 103 Early hints (golang/go#42597). The implementation of HTTP server changed to allow for 1xx headers so now a common way to set them is to set headers and then call WriteHeader(StatusEarlyHints) which then allows setting more headers and then call do regular response writing, calling WriteHeader again, or just calling Write.

From looking around a bit around code here, I think CaptureMetrics might not work correctly, as it assumes WriteHeader is written only once. I can make a PR to fix that.

But I am not sure about any other breakage which might be happening because of that change. Anything?

mitar commented

I made #24.

#24 is merged.