Fix spelling (#2202)

This commit is contained in:
John Bampton
2020-01-07 11:19:49 +10:00
committed by thinkerou
parent 59ab588bf5
commit b8a7b6d194
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -1003,20 +1003,20 @@ func (c *Context) NegotiateFormat(offered ...string) string {
return offered[0]
}
for _, accepted := range c.Accepted {
for _, offert := range offered {
for _, offer := range offered {
// 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++ {
if accepted[i] == '*' || offert[i] == '*' {
return offert
if accepted[i] == '*' || offer[i] == '*' {
return offer
}
if accepted[i] != offert[i] {
if accepted[i] != offer[i] {
break
}
}
if i == len(accepted) {
return offert
return offer
}
}
}