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:
Athurg Gooth 2014-12-25 11:23:04 +08:00
parent 0e1a0049d1
commit d961ae4cd8
1 changed files with 1 additions and 1 deletions

View File

@ -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")