fix: use html/template
This commit is contained in:
1 file changed
+5
-5
+5
-5
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user