Enable gzip encoding static files for webgui
This commit is contained in:
@@ -8,6 +8,8 @@ package auto_test
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"io/ioutil"
|
||||
"testing"
|
||||
|
||||
"github.com/syncthing/syncthing/internal/auto"
|
||||
@@ -19,6 +21,11 @@ func TestAssets(t *testing.T) {
|
||||
if !ok {
|
||||
t.Fatal("No index.html in compiled in assets")
|
||||
}
|
||||
|
||||
var gr *gzip.Reader
|
||||
gr, _ = gzip.NewReader(bytes.NewReader(idx))
|
||||
idx, _ = ioutil.ReadAll(gr)
|
||||
|
||||
if !bytes.Contains(idx, []byte("<html")) {
|
||||
t.Fatal("No html in index.html")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user