diff --git a/http/response/html/html.go b/http/response/html/html.go index c7bf1faf..3bba07f3 100644 --- a/http/response/html/html.go +++ b/http/response/html/html.go @@ -26,6 +26,7 @@ func ServerError(w http.ResponseWriter, r *http.Request, err error) { builder := response.New(w, r) builder.WithStatus(http.StatusInternalServerError) + builder.WithHeader("Content-Security-Policy", `default-src 'self'`) builder.WithHeader("Content-Type", "text/html; charset=utf-8") builder.WithHeader("Cache-Control", "no-cache, max-age=0, must-revalidate, no-store") builder.WithBody(err) @@ -38,6 +39,7 @@ func BadRequest(w http.ResponseWriter, r *http.Request, err error) { builder := response.New(w, r) builder.WithStatus(http.StatusBadRequest) + builder.WithHeader("Content-Security-Policy", `default-src 'self'`) builder.WithHeader("Content-Type", "text/html; charset=utf-8") builder.WithHeader("Cache-Control", "no-cache, max-age=0, must-revalidate, no-store") builder.WithBody(err) diff --git a/ui/proxy.go b/ui/proxy.go index 5dd50697..bffbc939 100644 --- a/ui/proxy.go +++ b/ui/proxy.go @@ -83,7 +83,8 @@ func (h *handler) mediaProxy(w http.ResponseWriter, r *http.Request) { resp, err := clt.Do(req) if err != nil { - html.ServerError(w, r, err) + logger.Error(`[Proxy] Unable to initialize HTTP client: %v`, err) + http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) return } defer resp.Body.Close()