Unwrap unnecessary bytes.NewReader

This commit is contained in:
Andrea Spacca 2021-03-19 08:25:40 +01:00
parent a90d29700d
commit 69519d8fa4

View file

@ -1011,11 +1011,7 @@ func (s *Server) getHandler(w http.ResponseWriter, r *http.Request) {
if disposition == "inline" && strings.Contains(contentType, "html") {
reader = ioutil.NopCloser(
bytes.NewReader(
bluemonday.UGCPolicy().
SanitizeReader(reader).
Bytes()))
reader = ioutil.NopCloser(bluemonday.UGCPolicy().SanitizeReader(reader))
}
if w.Header().Get("Range") == "" {