fix profile image on dashboard (#1637)

This commit is contained in:
Caleb Doxsey 2020-12-01 07:58:01 -07:00 committed by GitHub
parent 0d7980faef
commit b121e436f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 5 deletions

View file

@ -60,6 +60,15 @@ func NewTemplates() (*template.Template, error) {
}
t := template.New("pomerium-templates").Funcs(map[string]interface{}{
"safeURL": func(arg interface{}) template.URL {
return template.URL(fmt.Sprint(arg))
},
"safeHTML": func(arg interface{}) template.HTML {
return template.HTML(fmt.Sprint(arg))
},
"safeHTMLAttr": func(arg interface{}) template.HTMLAttr {
return template.HTMLAttr(fmt.Sprint(arg))
},
"dataURL": func(p string) template.URL {
return dataURLs[strings.TrimPrefix(p, "/.pomerium/assets")]
},