(api string, f http.HandlerFunc)
| 351 | } |
| 352 | |
| 353 | func collectAPIStats(api string, f http.HandlerFunc) http.HandlerFunc { |
| 354 | return func(w http.ResponseWriter, r *http.Request) { |
| 355 | globalHTTPStats.currentS3Requests.Inc(api) |
| 356 | defer globalHTTPStats.currentS3Requests.Dec(api) |
| 357 | |
| 358 | statsWriter := xhttp.NewResponseRecorder(w) |
| 359 | |
| 360 | f.ServeHTTP(statsWriter, r) |
| 361 | |
| 362 | globalHTTPStats.updateStats(api, r, statsWriter) |
| 363 | } |
| 364 | } |
| 365 | |
| 366 | // Returns "/bucketName/objectName" for path-style or virtual-host-style requests. |
| 367 | func getResource(path string, host string, domains []string) (string, error) { |
no test coverage detected