Merge pull request #1582 from ralder/webgui-enable-gzip

Enable gzip for static files for webgui
This commit is contained in:
Jakob Borg
2015-04-06 08:33:57 +02:00
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")
}

File diff suppressed because one or more lines are too long