mirror of
https://github.com/gin-gonic/gin.git
synced 2025-06-03 13:11:27 +08:00
Fix #723
This commit is contained in:
6
gin.go
6
gin.go
@ -19,6 +19,7 @@ const Version = "v1.0rc2"
|
||||
|
||||
var default404Body = []byte("404 page not found")
|
||||
var default405Body = []byte("405 method not allowed")
|
||||
var defaultAppEngine bool
|
||||
|
||||
type HandlerFunc func(*Context)
|
||||
type HandlersChain []HandlerFunc
|
||||
@ -78,6 +79,10 @@ type (
|
||||
// handler.
|
||||
HandleMethodNotAllowed bool
|
||||
ForwardedByClientIP bool
|
||||
|
||||
// #726 #755 If enabled, it will thrust some headers starting with
|
||||
// 'X-AppEngine...' for better integration with that PaaS.
|
||||
AppEngine bool
|
||||
}
|
||||
)
|
||||
|
||||
@ -101,6 +106,7 @@ func New() *Engine {
|
||||
RedirectFixedPath: false,
|
||||
HandleMethodNotAllowed: false,
|
||||
ForwardedByClientIP: true,
|
||||
AppEngine: defaultAppEngine,
|
||||
trees: make(methodTrees, 0, 9),
|
||||
}
|
||||
engine.RouterGroup.engine = engine
|
||||
|
Reference in New Issue
Block a user