diff --git a/context.go b/context.go index a42ee63..05ea085 100644 --- a/context.go +++ b/context.go @@ -8,6 +8,7 @@ import ( "net/http" "git.twelvetwelve.org/library/snap/auth" + "github.com/gorilla/mux" ) type Context struct { @@ -191,21 +192,13 @@ func (c *Context) ReadObject(object interface{}) error { } func (c *Context) ParseVars() *Options { - if c.form != nil { - return &Options{ - kv: c.form, + if c.vars == nil { + c.vars = &Vars{ + vars: mux.Vars(c.r), } } - err := c.r.ParseForm() - if err != nil { - return nil - } - c.form = &Form{ - r: c.r, - } - return &Options{ - kv: c.form, + kv: c.vars, } } diff --git a/server.go b/server.go index cba2a5f..fb39673 100644 --- a/server.go +++ b/server.go @@ -57,6 +57,7 @@ func (s *Server) makeContext(auth *auth.AuthData, w http.ResponseWriter, r *http w: w, srv: s, auth: auth, + vars: mux.Vars(r), } return c }