Enable gzip encoding static files for webgui

This commit is contained in:
Sergey Mishin
2015-04-04 20:06:20 +03:00
parent a5edb6807e
commit 77882e6086
5 changed files with 122 additions and 263 deletions

View File

@@ -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")
}