File tree Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Expand file tree Collapse file tree 4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -126,9 +126,9 @@ type token struct{}
126126type throttler struct {
127127 tokens chan token
128128 backlogTokens chan token
129+ retryAfterFn func (ctxDone bool ) time.Duration
129130 backlogTimeout time.Duration
130131 statusCode int
131- retryAfterFn func (ctxDone bool ) time.Duration
132132}
133133
134134// setRetryAfterHeaderIfNeeded sets Retry-After HTTP header if corresponding retryAfterFn option of throttler is initialized.
Original file line number Diff line number Diff line change @@ -73,10 +73,10 @@ type WrapResponseWriter interface {
7373// http.ResponseWriter interface.
7474type basicWriter struct {
7575 http.ResponseWriter
76- wroteHeader bool
76+ tee io. Writer
7777 code int
7878 bytes int
79- tee io. Writer
79+ wroteHeader bool
8080 discard bool
8181}
8282
Original file line number Diff line number Diff line change @@ -644,11 +644,11 @@ func TestMuxHandlePatternValidation(t *testing.T) {
644644 testCases := []struct {
645645 name string
646646 pattern string
647+ method string
648+ path string
649+ expectedBody string
650+ expectedStatus int
647651 shouldPanic bool
648- method string // Method to be used for the test request
649- path string // Path to be used for the test request
650- expectedBody string // Expected response body
651- expectedStatus int // Expected HTTP status code
652652 }{
653653 // Valid patterns
654654 {
Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ func TestPathValue(t *testing.T) {
1515 name string
1616 pattern string
1717 method string
18- pathKeys []string
1918 requestPath string
2019 expectedBody string
20+ pathKeys []string
2121 }{
2222 {
2323 name : "Basic path value" ,
You can’t perform that action at this time.
0 commit comments