We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e506d38 commit e9b5e22Copy full SHA for e9b5e22
rpc/http.go
@@ -169,7 +169,8 @@ func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
169
// All checks passed, create a codec that reads direct from the request body
170
// untilEOF and writes the response to w and order the server to process a
171
// single request.
172
- codec := NewJSONCodec(&httpReadWriteNopCloser{r.Body, w})
+ body := io.LimitReader(r.Body, maxRequestContentLength)
173
+ codec := NewJSONCodec(&httpReadWriteNopCloser{body, w})
174
defer codec.Close()
175
176
w.Header().Set("content-type", contentType)
0 commit comments