1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 20:30:55 +00:00

fix param to params

This commit is contained in:
astaxie 2013-11-26 11:16:22 +08:00
parent ae2e25f4c2
commit f9e732b5ce

View File

@ -581,7 +581,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
} }
} }
context.Input.Param = params context.Input.Params = params
if runrouter != nil { if runrouter != nil {
if r.Method == "POST" { if r.Method == "POST" {
@ -766,7 +766,7 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
lastindex := strings.LastIndex(requestPath, "/") lastindex := strings.LastIndex(requestPath, "/")
lastsub := requestPath[lastindex+1:] lastsub := requestPath[lastindex+1:]
if subindex := strings.LastIndex(lastsub, "."); subindex != -1 { if subindex := strings.LastIndex(lastsub, "."); subindex != -1 {
context.Input.Param[":ext"] = lastsub[subindex+1:] context.Input.Params[":ext"] = lastsub[subindex+1:]
r.URL.Query().Add(":ext", lastsub[subindex+1:]) r.URL.Query().Add(":ext", lastsub[subindex+1:])
r.URL.RawQuery = r.URL.Query().Encode() r.URL.RawQuery = r.URL.Query().Encode()
requestPath = requestPath[:len(requestPath)-len(lastsub[subindex:])] requestPath = requestPath[:len(requestPath)-len(lastsub[subindex:])]