fix: use html/template

This commit is contained in:
Henrique Dias committed 2026-03-28 19:16:12 +01:00
1 parent 126227bb27
commit d9f9460c1e
1 file changed
+5 -5
+5 -5
View File
@@ -1,19 +1,19 @@
package fbhttp
import (
"compress/gzip"
"encoding/json"
"errors"
"fmt"
"io/fs"
"html/template"
"io"
"compress/gzip"
"io/fs"
"log"
"net/http"
"os"
"path"
"path/filepath"
"strings"
"text/template"
"github.com/filebrowser/filebrowser/v2/auth"
"github.com/filebrowser/filebrowser/v2/settings"
@@ -153,7 +153,7 @@ func getStaticHandlers(store *storage.Storage, server *settings.Server, assetsFs
defer f.Close()
acceptEncoding := r.Header.Get("Accept-Encoding")
if strings.Contains(acceptEncoding, "gzip") {
if strings.Contains(acceptEncoding, "gzip") {
w.Header().Set("Content-Encoding", "gzip")
w.Header().Set("Content-Type", "application/javascript; charset=utf-8")
@@ -168,7 +168,7 @@ func getStaticHandlers(store *storage.Storage, server *settings.Server, assetsFs
defer gzReader.Close()
w.Header().Set("Content-Type", "application/javascript; charset=utf-8")
if _, err := io.Copy(w, gzReader); err != nil {
return http.StatusInternalServerError, err
}