mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
simplify recordAPIStats wrapper for ResponseWriters (#9034)
This commit is contained in:
@@ -538,9 +538,8 @@ func setHTTPStatsHandler(h http.Handler) http.Handler {
|
||||
func (h httpStatsHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
isS3Request := !strings.HasPrefix(r.URL.Path, minioReservedBucketPath)
|
||||
// record s3 connection stats.
|
||||
recordRequest := &recordTrafficRequest{ReadCloser: r.Body, isS3Request: isS3Request}
|
||||
r.Body = recordRequest
|
||||
recordResponse := &recordTrafficResponse{w, isS3Request}
|
||||
r.Body = &recordTrafficRequest{ReadCloser: r.Body, isS3Request: isS3Request}
|
||||
recordResponse := &recordTrafficResponse{ResponseWriter: w, isS3Request: isS3Request}
|
||||
// Execute the request
|
||||
h.handler.ServeHTTP(recordResponse, r)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user