Skip to content

Commit

Permalink
iss-1272: Fix concurrent writes when rendering html templates in ui (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lx223 authored and povilasv committed Jun 27, 2019
1 parent 11d7798 commit dbbeeb5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/ui/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ func (bu *BaseUI) executeTemplate(w http.ResponseWriter, name string, prefix str
return
}

bu.tmplFuncs["pathPrefix"] = func() string { return prefix }

t, err := template.New("").Funcs(bu.tmplFuncs).Parse(text)
t, err := template.New("").Funcs(bu.tmplFuncs).
Funcs(template.FuncMap{"pathPrefix": func() string { return prefix }}).
Parse(text)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
Expand Down

0 comments on commit dbbeeb5

Please sign in to comment.