mirror of
https://github.com/minio/minio.git
synced 2025-01-13 16:03:21 -05:00
Adding error message on connection limit met
This commit is contained in:
parent
8d1d309630
commit
f596c744ed
@ -61,6 +61,8 @@ func (c *connLimit) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
if c.TestAndAdd(longIP) {
|
||||
defer c.Remove(longIP)
|
||||
c.handler.ServeHTTP(w, req)
|
||||
} else {
|
||||
writeErrorResponse(w, req, ConnectionLimitExceeded, req.RequestURI)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,7 @@ const (
|
||||
BandWidthQuotaExceeded
|
||||
BandWidthInsufficientToProceed
|
||||
SlowDown
|
||||
ConnectionLimitExceeded
|
||||
)
|
||||
|
||||
// Golang http doesn't implement these
|
||||
@ -89,6 +90,11 @@ var errorCodeResponse = map[int]Error{
|
||||
Description: "Reduce your request rate.",
|
||||
HTTPStatusCode: StatusTooManyRequests,
|
||||
},
|
||||
ConnectionLimitExceeded: {
|
||||
Code: "ConnectionLimit",
|
||||
Description: "Connection Limit Met",
|
||||
HTTPStatusCode: StatusTooManyRequests,
|
||||
},
|
||||
}
|
||||
|
||||
// Write error response headers
|
||||
|
Loading…
Reference in New Issue
Block a user