mirror of
https://github.com/golang/go
synced 2024-11-11 20:20:23 -07:00
Add some documentation of what w does
This commit is contained in:
parent
cd6ff5d35a
commit
6ae68402a5
@ -1128,7 +1128,9 @@ func readRequest(b *bufio.Reader) (req *Request, err error) {
|
||||
// underlying reader when its Close method is called.
|
||||
//
|
||||
// MaxBytesReader prevents clients from accidentally or maliciously
|
||||
// sending a large request and wasting server resources.
|
||||
// sending a large request and wasting server resources. If possible,
|
||||
// it tells the ResponseWriter to close the connection after the limit
|
||||
// has been reached.
|
||||
func MaxBytesReader(w ResponseWriter, r io.ReadCloser, n int64) io.ReadCloser {
|
||||
if n < 0 { // Treat negative limits as equivalent to 0.
|
||||
n = 0
|
||||
|
Loading…
Reference in New Issue
Block a user