Don't strip URL params
Anirudh Oppiliappan x@icyphox.sh
Mon, 27 Sep 2021 22:40:51 +0530
1 files changed,
1 insertions(+),
8 deletions(-)
jump to
M
mail/template.go
→
mail/template.go
@@ -3,17 +3,10 @@
import ( "bytes" "html/template" - "net/url" "path/filepath" "git.icyphox.sh/forlater/navani/reader" ) - -func stripQueryParams(u *url.URL) string { - u.RawQuery = "" - u.Fragment = "" - return u.String() -} func RenderTemplate(file string, article *reader.Article) ([]byte, error) { t, err := template.ParseGlob(filepath.Join("templates", "*.tpl"))@@ -31,7 +24,7 @@ }{
template.HTML(article.Content), article.Title, article.Byline, - stripQueryParams(article.URL), + article.URL.String(), }); err != nil { return nil, err }