mirror of
https://github.com/astaxie/beego.git
synced 2024-11-22 12:50:55 +00:00
Fix RequestURI nil caused template parse failed
Sometime RequestURI is not set, e.g. running after a front proxy server. We should always follow the document's directive, to use Request.URL instead of RequestURI. Refer: http://golang.org/pkg/net/http/#Request
This commit is contained in:
parent
0e1a0049d1
commit
d961ae4cd8
@ -114,7 +114,7 @@ func (p *Paginator) Pages() []int {
|
||||
|
||||
// Returns URL for a given page index.
|
||||
func (p *Paginator) PageLink(page int) string {
|
||||
link, _ := url.ParseRequestURI(p.Request.RequestURI)
|
||||
link, _ := url.ParseRequestURI(p.Request.URL.String())
|
||||
values := link.Query()
|
||||
if page == 1 {
|
||||
values.Del("p")
|
||||
|
Loading…
Reference in New Issue
Block a user