From d961ae4cd8cbde67f4b23ad5e58739169c8cab10 Mon Sep 17 00:00:00 2001 From: Athurg Gooth Date: Thu, 25 Dec 2014 11:23:04 +0800 Subject: [PATCH] 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 --- utils/pagination/paginator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/pagination/paginator.go b/utils/pagination/paginator.go index f89e878e..e537f1ad 100644 --- a/utils/pagination/paginator.go +++ b/utils/pagination/paginator.go @@ -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")