feat: add middlewares config for rest (#2765)
* feat: add middlewares config for rest * chore: disable logs in tests * chore: enable verbose in tests
This commit is contained in:
@@ -8,8 +8,8 @@ import (
|
||||
"github.com/zeromicro/go-zero/rest/internal"
|
||||
)
|
||||
|
||||
// MaxConns returns a middleware that limit the concurrent connections.
|
||||
func MaxConns(n int) func(http.Handler) http.Handler {
|
||||
// MaxConnsHandler returns a middleware that limit the concurrent connections.
|
||||
func MaxConnsHandler(n int) func(http.Handler) http.Handler {
|
||||
if n <= 0 {
|
||||
return func(next http.Handler) http.Handler {
|
||||
return next
|
||||
|
||||
Reference in New Issue
Block a user