Skip to content

Commit 79c450e

Browse files
Copilotintel352
andauthored
fix: accurate rate-limit schema descriptions and DefaultConfig consistency (#112)
* Initial plan * fix: clarify requestsPerHour precedence and add to DefaultConfig in rate limit schema Co-authored-by: intel352 <77607+intel352@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
1 parent 3944139 commit 79c450e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

plugins/http/schemas.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,11 @@ func rateLimitMiddlewareSchema() *schema.ModuleSchema {
159159
Inputs: []schema.ServiceIODef{{Name: "request", Type: "http.Request", Description: "HTTP request to rate-limit"}},
160160
Outputs: []schema.ServiceIODef{{Name: "limited", Type: "http.Request", Description: "HTTP request (passed through if within limit)"}},
161161
ConfigFields: []schema.ConfigFieldDef{
162-
{Key: "requestsPerMinute", Label: "Requests Per Minute", Type: schema.FieldTypeNumber, DefaultValue: 60, Description: "Maximum number of requests per minute per client (mutually exclusive with requestsPerHour)"},
162+
{Key: "requestsPerMinute", Label: "Requests Per Minute", Type: schema.FieldTypeNumber, DefaultValue: 60, Description: "Maximum number of requests per minute per client; used when requestsPerHour is not set"},
163163
{Key: "requestsPerHour", Label: "Requests Per Hour", Type: schema.FieldTypeNumber, DefaultValue: 0, Description: "Maximum number of requests per hour per client; takes precedence over requestsPerMinute when set"},
164164
{Key: "burstSize", Label: "Burst Size", Type: schema.FieldTypeNumber, DefaultValue: 10, Description: "Maximum burst of requests allowed above the rate limit"},
165165
},
166-
DefaultConfig: map[string]any{"requestsPerMinute": 60, "burstSize": 10},
166+
DefaultConfig: map[string]any{"requestsPerMinute": 60, "requestsPerHour": 0, "burstSize": 10},
167167
}
168168
}
169169

0 commit comments

Comments
 (0)