mirror of
https://github.com/minio/minio.git
synced 2026-11-13 14:44:19 +00:00
simplify recordAPIStats wrapper for ResponseWriters (#9034)
This commit is contained in:
1 parent
4c92bec619
commit
ece0d4ac53
3 files changed
+12
-27
No files matched your search
@@ -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