Fixes crash when route path doesn't start with '/'
This commit is contained in:
parent
b8798ec5f7
commit
2b6cf3889e
2
gin.go
2
gin.go
@ -75,7 +75,7 @@ func (a ErrorMsgs) String() string {
|
||||
// The most basic configuration
|
||||
func New() *Engine {
|
||||
engine := &Engine{}
|
||||
engine.RouterGroup = &RouterGroup{nil, "", nil, engine}
|
||||
engine.RouterGroup = &RouterGroup{nil, "/", nil, engine}
|
||||
engine.router = httprouter.New()
|
||||
engine.router.NotFound = engine.handle404
|
||||
return engine
|
||||
|
Loading…
Reference in New Issue
Block a user