mirror of https://github.com/gin-gonic/gin.git
Fix spelling (#2202)
This commit is contained in:
parent
59ab588bf5
commit
b8a7b6d194
|
@ -196,7 +196,7 @@
|
||||||
- [PERFORMANCE] Misc code optimizations. Inlining, tail call optimizations
|
- [PERFORMANCE] Misc code optimizations. Inlining, tail call optimizations
|
||||||
- [NEW] Built-in support for golang.org/x/net/context
|
- [NEW] Built-in support for golang.org/x/net/context
|
||||||
- [NEW] Any(path, handler). Create a route that matches any path
|
- [NEW] Any(path, handler). Create a route that matches any path
|
||||||
- [NEW] Refactored rendering pipeline (faster and static typeded)
|
- [NEW] Refactored rendering pipeline (faster and static typed)
|
||||||
- [NEW] Refactored errors API
|
- [NEW] Refactored errors API
|
||||||
- [NEW] IndentedJSON() prints pretty JSON
|
- [NEW] IndentedJSON() prints pretty JSON
|
||||||
- [NEW] Added gin.DefaultWriter
|
- [NEW] Added gin.DefaultWriter
|
||||||
|
@ -295,7 +295,7 @@
|
||||||
- [FIX] Recovery() middleware only prints panics
|
- [FIX] Recovery() middleware only prints panics
|
||||||
- [FIX] Context.Get() does not panic anymore. Use MustGet() instead.
|
- [FIX] Context.Get() does not panic anymore. Use MustGet() instead.
|
||||||
- [FIX] Multiple http.WriteHeader() in NotFound handlers
|
- [FIX] Multiple http.WriteHeader() in NotFound handlers
|
||||||
- [FIX] Engine.Run() panics if http server can't be setted up
|
- [FIX] Engine.Run() panics if http server can't be set up
|
||||||
- [FIX] Crash when route path doesn't start with '/'
|
- [FIX] Crash when route path doesn't start with '/'
|
||||||
- [FIX] Do not update header when status code is negative
|
- [FIX] Do not update header when status code is negative
|
||||||
- [FIX] Setting response headers before calling WriteHeader in context.String()
|
- [FIX] Setting response headers before calling WriteHeader in context.String()
|
||||||
|
|
10
context.go
10
context.go
|
@ -1003,20 +1003,20 @@ func (c *Context) NegotiateFormat(offered ...string) string {
|
||||||
return offered[0]
|
return offered[0]
|
||||||
}
|
}
|
||||||
for _, accepted := range c.Accepted {
|
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,
|
// 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
|
// therefore we can just iterate over the string without casting it into []rune
|
||||||
i := 0
|
i := 0
|
||||||
for ; i < len(accepted); i++ {
|
for ; i < len(accepted); i++ {
|
||||||
if accepted[i] == '*' || offert[i] == '*' {
|
if accepted[i] == '*' || offer[i] == '*' {
|
||||||
return offert
|
return offer
|
||||||
}
|
}
|
||||||
if accepted[i] != offert[i] {
|
if accepted[i] != offer[i] {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if i == len(accepted) {
|
if i == len(accepted) {
|
||||||
return offert
|
return offer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue