writeBadRequest is the client-side counterpart to writeBadGateway: 400-class so the failure isn't misattributed to the upstream by downstream proxies / monitoring. Used when we detect a malformed or truncated request from the downstream client (e.g., Content-Length mismatch during replay-safety pre-
(c net.Conn)
| 1003 | // or truncated request from the downstream client (e.g., |
| 1004 | // Content-Length mismatch during replay-safety pre-buffering). |
| 1005 | func writeBadRequest(c net.Conn) { |
| 1006 | _, _ = c.Write([]byte("HTTP/1.1 400 Bad Request\r\nContent-Length: 0\r\nConnection: close\r\n\r\n")) |
| 1007 | } |
| 1008 | |
| 1009 | // handleHttp1ZeroCopy handles HTTP/1.x connections in normal (non-sync) and |
| 1010 | // sampling modes. |
no test coverage detected