Go 1.20+ added support for full duplex mode which allows HTTP server handlers to concurrently read from the request and write response. Enable full duplex mode for HTTP/1 requests (HTTP/2 already supports it and EnableFullDuplex fails for HTTP/2)
Bump negroni to v3 to get Unwrap on negroni.ResponseWriter as well. The release change PR is here
An explanation of the use cases your change solves
Stream processing, early validation to cancel large requests, 100 Continue scenarios.
Instructions to functionally test the behavior change using operator interfaces (BOSH manifest, logs, curl, and metrics)
Push an app that validates custom header in request and sends 400 response before reading the request body. Have a client that sends HTTP/1 request without closing its body, gets response and cancels request if 401. An example of such client is here
Expected result after the change
Request is canceled before the request body is written.
Current result before the change
Gorouter is waiting for the full request body first before sending response back.
Links to any other associated PRs
[X] I have viewed signed and have submitted the Contributor License Agreement
[X] I have made this pull request to the main branch
Go 1.20+ added support for full duplex mode which allows HTTP server handlers to concurrently read from the request and write response. Enable full duplex mode for HTTP/1 requests (HTTP/2 already supports it and EnableFullDuplex fails for HTTP/2)
Add Unwrap to utils.ResponseWriter to satisfy http.ResponseController support (Go 1.20+) https://pkg.go.dev/net/http#NewResponseController
Bump negroni to v3 to get Unwrap on negroni.ResponseWriter as well. The release change PR is here
Stream processing, early validation to cancel large requests, 100 Continue scenarios.
Push an app that validates custom header in request and sends 400 response before reading the request body. Have a client that sends HTTP/1 request without closing its body, gets response and cancels request if 401. An example of such client is here
Request is canceled before the request body is written.
Gorouter is waiting for the full request body first before sending response back.
Links to any other associated PRs
[X] I have viewed signed and have submitted the Contributor License Agreement
[X] I have made this pull request to the
main
branch[X] I have run all the unit tests.
[ ] (Optional) I have run Routing Acceptance Tests and Routing Smoke Tests
[ ] (Optional) I have run CF Acceptance Tests