fix(context): panic on NegotiateFormat - index out of range (#3397)
This commit is contained in:
committed by
GitHub
parent
3010cbd7f4
commit
7cb151bb4c
@ -1147,7 +1147,7 @@ func (c *Context) NegotiateFormat(offered ...string) string {
|
||||
// According to RFC 2616 and RFC 2396, non-ASCII characters are not allowed in headers,
|
||||
// therefore we can just iterate over the string without casting it into []rune
|
||||
i := 0
|
||||
for ; i < len(accepted); i++ {
|
||||
for ; i < len(accepted) && i < len(offer); i++ {
|
||||
if accepted[i] == '*' || offer[i] == '*' {
|
||||
return offer
|
||||
}
|
||||
|
Reference in New Issue
Block a user