mirror of
https://github.com/astaxie/beego.git
synced 2024-11-26 07:51:30 +00:00
fix param to params
This commit is contained in:
parent
ae2e25f4c2
commit
f9e732b5ce
@ -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:])]
|
||||||
|
Loading…
Reference in New Issue
Block a user