diff options
author | 2019-12-03 17:31:53 +0100 | |
---|---|---|
committer | 2019-12-03 17:31:53 +0100 | |
commit | a4729060bedd45481726861c491d5061e90ffefa (patch) | |
tree | d9ee85915912c2186162e5ae737f89d3a5751549 /template.go | |
parent | 48d6d5d227a4d55d80f9f2a74c1242cafafab7ab (diff) | |
download | alps-a4729060bedd45481726861c491d5061e90ffefa.tar.gz alps-a4729060bedd45481726861c491d5061e90ffefa.tar.bz2 alps-a4729060bedd45481726861c491d5061e90ffefa.zip |
Escape mailbox names in URLs
Closes: https://todo.sr.ht/~sircmpwn/koushin/14
Diffstat (limited to 'template.go')
-rw-r--r-- | template.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/template.go b/template.go index 5d0d28b..2581da0 100644 --- a/template.go +++ b/template.go @@ -3,6 +3,7 @@ package koushin import ( "html/template" "io" + "net/url" "github.com/labstack/echo/v4" ) @@ -20,6 +21,9 @@ func loadTemplates() (*tmpl, error) { "tuple": func(values ...interface{}) []interface{} { return values }, + "pathescape": func(s string) string { + return url.PathEscape(s) + }, }).ParseGlob("public/*.html") return &tmpl{t}, err } |