1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2024-11-24 08:52:25 +02:00

Pass ProxyPrefix into the error template.

The default `error.html` uses `ProxyPrefix` but it isn't supplied in the context, causing it to error.
This commit is contained in:
John Boxall 2015-10-03 15:59:47 -07:00
parent 3ed828ef45
commit a653c3eeeb

View File

@ -287,11 +287,13 @@ func (p *OauthProxy) ErrorPage(rw http.ResponseWriter, code int, title string, m
log.Printf("ErrorPage %d %s %s", code, title, message)
rw.WriteHeader(code)
t := struct {
Title string
Message string
Title string
Message string
ProxyPrefix string
}{
Title: fmt.Sprintf("%d %s", code, title),
Message: message,
Title: fmt.Sprintf("%d %s", code, title),
Message: message,
ProxyPrefix: p.ProxyPrefix,
}
p.templates.ExecuteTemplate(rw, "error.html", t)
}