ContentMiddleware returns a middleware handler to process reader for content. If the request contains the "X-amz-Decoded-Content-Length" header, it means that the data in the request body is chunked. Use ChunkedReader to parse the data.
(next http.Handler)
| 196 | // If the request contains the "X-amz-Decoded-Content-Length" header, it means that the data |
| 197 | // in the request body is chunked. Use ChunkedReader to parse the data. |
| 198 | func (o *ObjectNode) contentMiddleware(next http.Handler) http.Handler { |
| 199 | var handlerFunc http.HandlerFunc = func(w http.ResponseWriter, r *http.Request) { |
| 200 | if r.Header.Get(XAmzDecodedContentLength) != "" && r.Header.Get(ContentEncoding) != streamingContentEncoding { |
| 201 | r.Body = NewClosableChunkedReader(r.Body) |
| 202 | log.LogDebugf("contentMiddleware: chunk reader inited: requestID(%v)", GetRequestID(r)) |
| 203 | } |
| 204 | next.ServeHTTP(w, r) |
| 205 | } |
| 206 | return handlerFunc |
| 207 | } |
| 208 | |
| 209 | // Http's Expect header is a special header. When nginx is used as the reverse proxy in the front |
| 210 | // end of ObjectNode, nginx will process the Expect header information in advance, send the http |
nothing calls this directly
no test coverage detected