feat: add trusted proxy identity and overload stats
This commit is contained in:
@@ -711,6 +711,9 @@ func TestServerConcurrentRequestLimit(t *testing.T) {
|
||||
if response.StatusCode != http.StatusServiceUnavailable {
|
||||
t.Fatalf("expected 503 at concurrency limit, got %d", response.StatusCode)
|
||||
}
|
||||
if stats := server.Stats(); stats.RejectedRequests != 1 {
|
||||
t.Fatalf("expected one rejected request, got %+v", stats)
|
||||
}
|
||||
close(release)
|
||||
response, err = http.ReadResponse(bufio.NewReader(first), &http.Request{Method: http.MethodGet})
|
||||
if err != nil {
|
||||
@@ -842,6 +845,9 @@ func TestServerConnectionLimitReleasesAfterRequest(t *testing.T) {
|
||||
t.Fatal("connection over MaxConnections was not rejected")
|
||||
}
|
||||
second.Close()
|
||||
if stats := server.Stats(); stats.RejectedConnections < 1 {
|
||||
t.Fatalf("expected rejected connection counter, got %+v", stats)
|
||||
}
|
||||
|
||||
close(release)
|
||||
firstResponse, err := http.ReadResponse(bufio.NewReader(first), &http.Request{Method: http.MethodGet})
|
||||
|
||||
Reference in New Issue
Block a user