update the go-restful dependency.

This commit is contained in:
Brendan Burns
2016-05-09 12:22:52 -07:00
parent 835a2577f8
commit 5572a1e1f3
5 changed files with 145 additions and 62 deletions

View File

@@ -36,9 +36,6 @@ func (w *WebService) SetDynamicRoutes(enable bool) {
// compilePathExpression ensures that the path is compiled into a RegEx for those routers that need it.
func (w *WebService) compilePathExpression() {
if len(w.rootPath) == 0 {
w.Path("/") // lazy initialize path
}
compiled, err := newPathExpression(w.rootPath)
if err != nil {
log.Printf("[restful] invalid path:%s because:%v", w.rootPath, err)
@@ -60,6 +57,9 @@ func (w WebService) Version() string { return w.apiVersion }
// All Routes will be relative to this path.
func (w *WebService) Path(root string) *WebService {
w.rootPath = root
if len(w.rootPath) == 0 {
w.rootPath = "/"
}
w.compilePathExpression()
return w
}