diff --git a/cmd/api-router.go b/cmd/api-router.go index f21e2789f..72a996504 100644 --- a/cmd/api-router.go +++ b/cmd/api-router.go @@ -108,7 +108,7 @@ func registerAPIRouter(router *mux.Router) { // Object operations // HeadObject bucket.Methods(http.MethodHead).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("headobject", httpTraceAll(api.HeadObjectHandler)))) + collectAPIStats("headobject", httpTraceAll(maxClients(api.HeadObjectHandler)))) // CopyObjectPart bucket.Methods(http.MethodPut).Path("/{object:.+}"). HeadersRegexp(xhttp.AmzCopySource, ".*?(\\/|%2F).*?"). @@ -116,216 +116,217 @@ func registerAPIRouter(router *mux.Router) { Queries("partNumber", "{partNumber:[0-9]+}", "uploadId", "{uploadId:.*}") // PutObjectPart bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("putobjectpart", httpTraceHdrs(api.PutObjectPartHandler)))).Queries("partNumber", "{partNumber:[0-9]+}", "uploadId", "{uploadId:.*}") + collectAPIStats("putobjectpart", httpTraceHdrs(maxClients(api.PutObjectPartHandler)))).Queries("partNumber", "{partNumber:[0-9]+}", "uploadId", "{uploadId:.*}") // ListObjectParts bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("listobjectparts", httpTraceAll(api.ListObjectPartsHandler)))).Queries("uploadId", "{uploadId:.*}") + collectAPIStats("listobjectparts", httpTraceAll(maxClients(api.ListObjectPartsHandler)))).Queries("uploadId", "{uploadId:.*}") // CompleteMultipartUpload bucket.Methods(http.MethodPost).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("completemutipartupload", httpTraceAll(api.CompleteMultipartUploadHandler)))).Queries("uploadId", "{uploadId:.*}") + collectAPIStats("completemutipartupload", httpTraceAll(maxClients(api.CompleteMultipartUploadHandler)))).Queries("uploadId", "{uploadId:.*}") // NewMultipartUpload bucket.Methods(http.MethodPost).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("newmultipartupload", httpTraceAll(api.NewMultipartUploadHandler)))).Queries("uploads", "") + collectAPIStats("newmultipartupload", httpTraceAll(maxClients(api.NewMultipartUploadHandler)))).Queries("uploads", "") // AbortMultipartUpload bucket.Methods(http.MethodDelete).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("abortmultipartupload", httpTraceAll(api.AbortMultipartUploadHandler)))).Queries("uploadId", "{uploadId:.*}") + collectAPIStats("abortmultipartupload", httpTraceAll(maxClients(api.AbortMultipartUploadHandler)))).Queries("uploadId", "{uploadId:.*}") // GetObjectACL - this is a dummy call. bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("getobjectacl", httpTraceHdrs(api.GetObjectACLHandler)))).Queries("acl", "") + collectAPIStats("getobjectacl", httpTraceHdrs(maxClients(api.GetObjectACLHandler)))).Queries("acl", "") // PutObjectACL - this is a dummy call. bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("putobjectacl", httpTraceHdrs(api.PutObjectACLHandler)))).Queries("acl", "") + collectAPIStats("putobjectacl", httpTraceHdrs(maxClients(api.PutObjectACLHandler)))).Queries("acl", "") // GetObjectTagging bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("getobjecttagging", httpTraceHdrs(api.GetObjectTaggingHandler)))).Queries("tagging", "") + collectAPIStats("getobjecttagging", httpTraceHdrs(maxClients(api.GetObjectTaggingHandler)))).Queries("tagging", "") // PutObjectTagging bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("putobjecttagging", httpTraceHdrs(api.PutObjectTaggingHandler)))).Queries("tagging", "") + collectAPIStats("putobjecttagging", httpTraceHdrs(maxClients(api.PutObjectTaggingHandler)))).Queries("tagging", "") // DeleteObjectTagging bucket.Methods(http.MethodDelete).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("deleteobjecttagging", httpTraceHdrs(api.DeleteObjectTaggingHandler)))).Queries("tagging", "") + collectAPIStats("deleteobjecttagging", httpTraceHdrs(maxClients(api.DeleteObjectTaggingHandler)))).Queries("tagging", "") // SelectObjectContent bucket.Methods(http.MethodPost).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("selectobjectcontent", httpTraceHdrs(api.SelectObjectContentHandler)))).Queries("select", "").Queries("select-type", "2") + collectAPIStats("selectobjectcontent", httpTraceHdrs(maxClients(api.SelectObjectContentHandler)))).Queries("select", "").Queries("select-type", "2") // GetObjectRetention bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("getobjectretention", httpTraceAll(api.GetObjectRetentionHandler)))).Queries("retention", "") + collectAPIStats("getobjectretention", httpTraceAll(maxClients(api.GetObjectRetentionHandler)))).Queries("retention", "") // GetObjectLegalHold bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("getobjectlegalhold", httpTraceAll(api.GetObjectLegalHoldHandler)))).Queries("legal-hold", "") + collectAPIStats("getobjectlegalhold", httpTraceAll(maxClients(api.GetObjectLegalHoldHandler)))).Queries("legal-hold", "") // GetObject bucket.Methods(http.MethodGet).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("getobject", httpTraceHdrs(api.GetObjectHandler)))) + collectAPIStats("getobject", httpTraceHdrs(maxClients(api.GetObjectHandler)))) // CopyObject - bucket.Methods(http.MethodPut).Path("/{object:.+}").HeadersRegexp(xhttp.AmzCopySource, ".*?(\\/|%2F).*?"). - HandlerFunc(maxClients(collectAPIStats("copyobject", httpTraceAll(api.CopyObjectHandler)))) + bucket.Methods(http.MethodPut).Path("/{object:.+}").HeadersRegexp(xhttp.AmzCopySource, ".*?(\\/|%2F).*?").HandlerFunc( + collectAPIStats("copyobject", httpTraceAll(maxClients(api.CopyObjectHandler)))) // PutObjectRetention bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("putobjectretention", httpTraceAll(api.PutObjectRetentionHandler)))).Queries("retention", "") + collectAPIStats("putobjectretention", httpTraceAll(maxClients(api.PutObjectRetentionHandler)))).Queries("retention", "") // PutObjectLegalHold bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("putobjectlegalhold", httpTraceAll(api.PutObjectLegalHoldHandler)))).Queries("legal-hold", "") + collectAPIStats("putobjectlegalhold", httpTraceAll(maxClients(api.PutObjectLegalHoldHandler)))).Queries("legal-hold", "") // PutObject bucket.Methods(http.MethodPut).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("putobject", httpTraceHdrs(api.PutObjectHandler)))) + collectAPIStats("putobject", httpTraceHdrs(maxClients(api.PutObjectHandler)))) // DeleteObject bucket.Methods(http.MethodDelete).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("deleteobject", httpTraceAll(api.DeleteObjectHandler)))) + collectAPIStats("deleteobject", httpTraceAll(maxClients(api.DeleteObjectHandler)))) /// Bucket operations // GetBucketLocation bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketlocation", httpTraceAll(api.GetBucketLocationHandler)))).Queries("location", "") + collectAPIStats("getbucketlocation", httpTraceAll(maxClients(api.GetBucketLocationHandler)))).Queries("location", "") // GetBucketPolicy bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketpolicy", httpTraceAll(api.GetBucketPolicyHandler)))).Queries("policy", "") + collectAPIStats("getbucketpolicy", httpTraceAll(maxClients(api.GetBucketPolicyHandler)))).Queries("policy", "") // GetBucketLifecycle bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketlifecycle", httpTraceAll(api.GetBucketLifecycleHandler)))).Queries("lifecycle", "") + collectAPIStats("getbucketlifecycle", httpTraceAll(maxClients(api.GetBucketLifecycleHandler)))).Queries("lifecycle", "") // GetBucketEncryption bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketencryption", httpTraceAll(api.GetBucketEncryptionHandler)))).Queries("encryption", "") + collectAPIStats("getbucketencryption", httpTraceAll(maxClients(api.GetBucketEncryptionHandler)))).Queries("encryption", "") // GetBucketObjectLockConfig bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketobjectlockconfiguration", httpTraceAll(api.GetBucketObjectLockConfigHandler)))).Queries("object-lock", "") + collectAPIStats("getbucketobjectlockconfiguration", httpTraceAll(maxClients(api.GetBucketObjectLockConfigHandler)))).Queries("object-lock", "") // GetBucketReplicationConfig bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketreplicationconfiguration", httpTraceAll(api.GetBucketReplicationConfigHandler)))).Queries("replication", "") + collectAPIStats("getbucketreplicationconfiguration", httpTraceAll(maxClients(api.GetBucketReplicationConfigHandler)))).Queries("replication", "") // GetBucketVersioning bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketversioning", httpTraceAll(api.GetBucketVersioningHandler)))).Queries("versioning", "") + collectAPIStats("getbucketversioning", httpTraceAll(maxClients(api.GetBucketVersioningHandler)))).Queries("versioning", "") // GetBucketNotification bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketnotification", httpTraceAll(api.GetBucketNotificationHandler)))).Queries("notification", "") + collectAPIStats("getbucketnotification", httpTraceAll(maxClients(api.GetBucketNotificationHandler)))).Queries("notification", "") // ListenNotification - bucket.Methods(http.MethodGet).HandlerFunc(collectAPIStats("listennotification", httpTraceAll(api.ListenNotificationHandler))).Queries("events", "{events:.*}") + bucket.Methods(http.MethodGet).HandlerFunc( + collectAPIStats("listennotification", httpTraceAll(maxClients(api.ListenNotificationHandler)))).Queries("events", "{events:.*}") // Dummy Bucket Calls // GetBucketACL -- this is a dummy call. bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketacl", httpTraceAll(api.GetBucketACLHandler)))).Queries("acl", "") + collectAPIStats("getbucketacl", httpTraceAll(maxClients(api.GetBucketACLHandler)))).Queries("acl", "") // PutBucketACL -- this is a dummy call. bucket.Methods(http.MethodPut).HandlerFunc( - maxClients(collectAPIStats("putbucketacl", httpTraceAll(api.PutBucketACLHandler)))).Queries("acl", "") + collectAPIStats("putbucketacl", httpTraceAll(maxClients(api.PutBucketACLHandler)))).Queries("acl", "") // GetBucketCors - this is a dummy call. bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketcors", httpTraceAll(api.GetBucketCorsHandler)))).Queries("cors", "") + collectAPIStats("getbucketcors", httpTraceAll(maxClients(api.GetBucketCorsHandler)))).Queries("cors", "") // GetBucketWebsiteHandler - this is a dummy call. bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketwebsite", httpTraceAll(api.GetBucketWebsiteHandler)))).Queries("website", "") + collectAPIStats("getbucketwebsite", httpTraceAll(maxClients(api.GetBucketWebsiteHandler)))).Queries("website", "") // GetBucketAccelerateHandler - this is a dummy call. bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketaccelerate", httpTraceAll(api.GetBucketAccelerateHandler)))).Queries("accelerate", "") + collectAPIStats("getbucketaccelerate", httpTraceAll(maxClients(api.GetBucketAccelerateHandler)))).Queries("accelerate", "") // GetBucketRequestPaymentHandler - this is a dummy call. bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketrequestpayment", httpTraceAll(api.GetBucketRequestPaymentHandler)))).Queries("requestPayment", "") + collectAPIStats("getbucketrequestpayment", httpTraceAll(maxClients(api.GetBucketRequestPaymentHandler)))).Queries("requestPayment", "") // GetBucketLoggingHandler - this is a dummy call. bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketlogging", httpTraceAll(api.GetBucketLoggingHandler)))).Queries("logging", "") + collectAPIStats("getbucketlogging", httpTraceAll(maxClients(api.GetBucketLoggingHandler)))).Queries("logging", "") // GetBucketLifecycleHandler - this is a dummy call. bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbucketlifecycle", httpTraceAll(api.GetBucketLifecycleHandler)))).Queries("lifecycle", "") + collectAPIStats("getbucketlifecycle", httpTraceAll(maxClients(api.GetBucketLifecycleHandler)))).Queries("lifecycle", "") // GetBucketTaggingHandler bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("getbuckettagging", httpTraceAll(api.GetBucketTaggingHandler)))).Queries("tagging", "") + collectAPIStats("getbuckettagging", httpTraceAll(maxClients(api.GetBucketTaggingHandler)))).Queries("tagging", "") //DeleteBucketWebsiteHandler bucket.Methods(http.MethodDelete).HandlerFunc( - maxClients(collectAPIStats("deletebucketwebsite", httpTraceAll(api.DeleteBucketWebsiteHandler)))).Queries("website", "") + collectAPIStats("deletebucketwebsite", httpTraceAll(maxClients(api.DeleteBucketWebsiteHandler)))).Queries("website", "") // DeleteBucketTaggingHandler bucket.Methods(http.MethodDelete).HandlerFunc( - maxClients(collectAPIStats("deletebuckettagging", httpTraceAll(api.DeleteBucketTaggingHandler)))).Queries("tagging", "") + collectAPIStats("deletebuckettagging", httpTraceAll(maxClients(api.DeleteBucketTaggingHandler)))).Queries("tagging", "") // ListMultipartUploads bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("listmultipartuploads", httpTraceAll(api.ListMultipartUploadsHandler)))).Queries("uploads", "") + collectAPIStats("listmultipartuploads", httpTraceAll(maxClients(api.ListMultipartUploadsHandler)))).Queries("uploads", "") // ListObjectsV2M bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("listobjectsv2M", httpTraceAll(api.ListObjectsV2MHandler)))).Queries("list-type", "2", "metadata", "true") + collectAPIStats("listobjectsv2M", httpTraceAll(maxClients(api.ListObjectsV2MHandler)))).Queries("list-type", "2", "metadata", "true") // ListObjectsV2 bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("listobjectsv2", httpTraceAll(api.ListObjectsV2Handler)))).Queries("list-type", "2") + collectAPIStats("listobjectsv2", httpTraceAll(maxClients(api.ListObjectsV2Handler)))).Queries("list-type", "2") // ListObjectVersions bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("listobjectversions", httpTraceAll(api.ListObjectVersionsHandler)))).Queries("versions", "") + collectAPIStats("listobjectversions", httpTraceAll(maxClients(api.ListObjectVersionsHandler)))).Queries("versions", "") // ListObjectsV1 (Legacy) bucket.Methods(http.MethodGet).HandlerFunc( - maxClients(collectAPIStats("listobjectsv1", httpTraceAll(api.ListObjectsV1Handler)))) + collectAPIStats("listobjectsv1", httpTraceAll(maxClients(api.ListObjectsV1Handler)))) // PutBucketLifecycle bucket.Methods(http.MethodPut).HandlerFunc( - maxClients(collectAPIStats("putbucketlifecycle", httpTraceAll(api.PutBucketLifecycleHandler)))).Queries("lifecycle", "") + collectAPIStats("putbucketlifecycle", httpTraceAll(maxClients(api.PutBucketLifecycleHandler)))).Queries("lifecycle", "") // PutBucketReplicationConfig bucket.Methods(http.MethodPut).HandlerFunc( - maxClients(collectAPIStats("putbucketreplicationconfiguration", httpTraceAll(api.PutBucketReplicationConfigHandler)))).Queries("replication", "") + collectAPIStats("putbucketreplicationconfiguration", httpTraceAll(maxClients(api.PutBucketReplicationConfigHandler)))).Queries("replication", "") // GetObjectRetention // PutBucketEncryption bucket.Methods(http.MethodPut).HandlerFunc( - maxClients(collectAPIStats("putbucketencryption", httpTraceAll(api.PutBucketEncryptionHandler)))).Queries("encryption", "") + collectAPIStats("putbucketencryption", httpTraceAll(maxClients(api.PutBucketEncryptionHandler)))).Queries("encryption", "") // PutBucketPolicy bucket.Methods(http.MethodPut).HandlerFunc( - maxClients(collectAPIStats("putbucketpolicy", httpTraceAll(api.PutBucketPolicyHandler)))).Queries("policy", "") + collectAPIStats("putbucketpolicy", httpTraceAll(maxClients(api.PutBucketPolicyHandler)))).Queries("policy", "") // PutBucketObjectLockConfig bucket.Methods(http.MethodPut).HandlerFunc( - maxClients(collectAPIStats("putbucketobjectlockconfig", httpTraceAll(api.PutBucketObjectLockConfigHandler)))).Queries("object-lock", "") + collectAPIStats("putbucketobjectlockconfig", httpTraceAll(maxClients(api.PutBucketObjectLockConfigHandler)))).Queries("object-lock", "") // PutBucketTaggingHandler bucket.Methods(http.MethodPut).HandlerFunc( - maxClients(collectAPIStats("putbuckettagging", httpTraceAll(api.PutBucketTaggingHandler)))).Queries("tagging", "") + collectAPIStats("putbuckettagging", httpTraceAll(maxClients(api.PutBucketTaggingHandler)))).Queries("tagging", "") // PutBucketVersioning bucket.Methods(http.MethodPut).HandlerFunc( - maxClients(collectAPIStats("putbucketversioning", httpTraceAll(api.PutBucketVersioningHandler)))).Queries("versioning", "") + collectAPIStats("putbucketversioning", httpTraceAll(maxClients(api.PutBucketVersioningHandler)))).Queries("versioning", "") // PutBucketNotification bucket.Methods(http.MethodPut).HandlerFunc( - maxClients(collectAPIStats("putbucketnotification", httpTraceAll(api.PutBucketNotificationHandler)))).Queries("notification", "") + collectAPIStats("putbucketnotification", httpTraceAll(maxClients(api.PutBucketNotificationHandler)))).Queries("notification", "") // PutBucket bucket.Methods(http.MethodPut).HandlerFunc( - maxClients(collectAPIStats("putbucket", httpTraceAll(api.PutBucketHandler)))) + collectAPIStats("putbucket", httpTraceAll(maxClients(api.PutBucketHandler)))) // HeadBucket bucket.Methods(http.MethodHead).HandlerFunc( - maxClients(collectAPIStats("headbucket", httpTraceAll(api.HeadBucketHandler)))) + collectAPIStats("headbucket", httpTraceAll(maxClients(api.HeadBucketHandler)))) // PostPolicy bucket.Methods(http.MethodPost).HeadersRegexp(xhttp.ContentType, "multipart/form-data*").HandlerFunc( - maxClients(collectAPIStats("postpolicybucket", httpTraceHdrs(api.PostPolicyBucketHandler)))) + collectAPIStats("postpolicybucket", httpTraceHdrs(maxClients(api.PostPolicyBucketHandler)))) // DeleteMultipleObjects bucket.Methods(http.MethodPost).HandlerFunc( - maxClients(collectAPIStats("deletemultipleobjects", httpTraceAll(api.DeleteMultipleObjectsHandler)))).Queries("delete", "") + collectAPIStats("deletemultipleobjects", httpTraceAll(maxClients(api.DeleteMultipleObjectsHandler)))).Queries("delete", "") // DeleteBucketPolicy bucket.Methods(http.MethodDelete).HandlerFunc( - maxClients(collectAPIStats("deletebucketpolicy", httpTraceAll(api.DeleteBucketPolicyHandler)))).Queries("policy", "") + collectAPIStats("deletebucketpolicy", httpTraceAll(maxClients(api.DeleteBucketPolicyHandler)))).Queries("policy", "") // DeleteBucketReplication bucket.Methods(http.MethodDelete).HandlerFunc( - maxClients(collectAPIStats("deletebucketreplicationconfiguration", httpTraceAll(api.DeleteBucketReplicationConfigHandler)))).Queries("replication", "") + collectAPIStats("deletebucketreplicationconfiguration", httpTraceAll(maxClients(api.DeleteBucketReplicationConfigHandler)))).Queries("replication", "") // DeleteBucketLifecycle bucket.Methods(http.MethodDelete).HandlerFunc( - maxClients(collectAPIStats("deletebucketlifecycle", httpTraceAll(api.DeleteBucketLifecycleHandler)))).Queries("lifecycle", "") + collectAPIStats("deletebucketlifecycle", httpTraceAll(maxClients(api.DeleteBucketLifecycleHandler)))).Queries("lifecycle", "") // DeleteBucketEncryption bucket.Methods(http.MethodDelete).HandlerFunc( - maxClients(collectAPIStats("deletebucketencryption", httpTraceAll(api.DeleteBucketEncryptionHandler)))).Queries("encryption", "") + collectAPIStats("deletebucketencryption", httpTraceAll(maxClients(api.DeleteBucketEncryptionHandler)))).Queries("encryption", "") // DeleteBucket bucket.Methods(http.MethodDelete).HandlerFunc( - maxClients(collectAPIStats("deletebucket", httpTraceAll(api.DeleteBucketHandler)))) + collectAPIStats("deletebucket", httpTraceAll(maxClients(api.DeleteBucketHandler)))) // PostRestoreObject bucket.Methods(http.MethodPost).Path("/{object:.+}").HandlerFunc( - maxClients(collectAPIStats("restoreobject", httpTraceAll(api.PostRestoreObjectHandler)))).Queries("restore", "") + collectAPIStats("restoreobject", httpTraceAll(maxClients(api.PostRestoreObjectHandler)))).Queries("restore", "") } /// Root operation // ListenNotification apiRouter.Methods(http.MethodGet).Path(SlashSeparator).HandlerFunc( - collectAPIStats("listennotification", httpTraceAll(api.ListenNotificationHandler))).Queries("events", "{events:.*}") + collectAPIStats("listennotification", httpTraceAll(maxClients(api.ListenNotificationHandler)))).Queries("events", "{events:.*}") // ListBuckets apiRouter.Methods(http.MethodGet).Path(SlashSeparator).HandlerFunc( - maxClients(collectAPIStats("listbuckets", httpTraceAll(api.ListBucketsHandler)))) + collectAPIStats("listbuckets", httpTraceAll(maxClients(api.ListBucketsHandler)))) // S3 browser with signature v4 adds '//' for ListBuckets request, so rather // than failing with UnknownAPIRequest we simply handle it for now. apiRouter.Methods(http.MethodGet).Path(SlashSeparator + SlashSeparator).HandlerFunc( - maxClients(collectAPIStats("listbuckets", httpTraceAll(api.ListBucketsHandler)))) + collectAPIStats("listbuckets", httpTraceAll(maxClients(api.ListBucketsHandler)))) // If none of the routes match add default error handler routes apiRouter.NotFoundHandler = collectAPIStats("notfound", httpTraceAll(errorResponseHandler))