@@ -74,11 +74,11 @@ func run(ctx context.Context, router Router, analyticsFile string) error {
}
}
server := &http.Server{Addr: *httpFlag, Handler: top{gzipHandler{&errorHandler{handler: (&handler{
rtr: router,
analyticsHTML: analyticsHTML,
analyticsHTML: template.HTML(analyticsHTML),
fontsHandler: httpgzip.FileServer(assets.Fonts, httpgzip.FileServerOptions{ServeError: httpgzip.Detailed}),
assetsHandler: httpgzip.FileServer(assets.Assets, httpgzip.FileServerOptions{ServeError: httpgzip.Detailed}),
s: newService(ctx),
}).ServeHTTP}}}}
@@ -104,11 +104,11 @@ func run(ctx context.Context, router Router, analyticsFile string) error {
// handler handles all goissues requests. It acts like a request multiplexer,
// choosing from various endpoints and parsing the import path from URL.
type handler struct {
rtr Router
analyticsHTML []byte
analyticsHTML template.HTML
fontsHandler http.Handler
assetsHandler http.Handler
s *service
}
@@ -155,11 +155,11 @@ func (h *handler) ServeIndex(w http.ResponseWriter, req *http.Request) error {
return httperror.Method{Allowed: []string{http.MethodGet}}
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
err := h.executeTemplate(w, req, "Header", map[string]interface{}{
"AnalyticsHTML": template.HTML(h.analyticsHTML),
"AnalyticsHTML": h.analyticsHTML,
})
if err != nil {
return err
}
@@ -238,11 +238,11 @@ func (h *handler) ServePackages(w http.ResponseWriter, req *http.Request) error
}
w.Header().Set("Content-Type", "text/html; charset=utf-8")
err := h.executeTemplate(w, req, "Header", map[string]interface{}{
"PageName": "Packages",
"AnalyticsHTML": template.HTML(h.analyticsHTML),
"AnalyticsHTML": h.analyticsHTML,
})
if err != nil {
return err
}