Skip to content

Commit 11896b8

Browse files
committed
fix: fix missing response header issue in fixed window strategy
1 parent ecad15b commit 11896b8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/llm_token_ratelimit/ratelimit_checker.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ func (c *FixedWindowChecker) checkLimitKey(ctx *Context, rule *MatchedRule) bool
8282
)
8383
return false
8484
}
85+
defer func() {
86+
ctx.Set(KeyResponseHeaders, responseHeader)
87+
}()
8588
responseHeader.Set(KeyRequestID, ctx.Get(KeyRequestID).(string))
8689
if remaining < 0 {
8790
responseHeader.Set(ResponseHeaderRemainingTokens, fmt.Sprintf("%d", remaining))

0 commit comments

Comments
 (0)