Fixes crash when route path doesn't start with '/'

This commit is contained in:
Manu Mtz-Almeida 2014-07-02 11:09:04 +02:00
parent b8798ec5f7
commit 2b6cf3889e

2
gin.go
View File

@ -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