From 942a06b0dd11838056fe9db11a90aa2a8945a1af Mon Sep 17 00:00:00 2001 From: Afonina Tatiana <99973342+tafonina@users.noreply.github.com> Date: Wed, 22 Feb 2023 19:38:28 +0200 Subject: [PATCH] Fix preview document bug (#295) * add more static js to Cache-Control fixes #292 [add more static js to Cache-Control] --------- Co-authored-by: s-pro <33251086+sprotest@users.noreply.github.com> Co-authored-by: epadalkin --- main/main.go | 2 +- test/assets/bindata.go | 60 ++++++++++++++++++------------------------ 2 files changed, 26 insertions(+), 36 deletions(-) diff --git a/main/main.go b/main/main.go index 57ca30f2b..8752b521f 100644 --- a/main/main.go +++ b/main/main.go @@ -112,7 +112,7 @@ func main() { e := www.Setup(ServerVersion) // Static route - e.GET("/static/*", StaticHandler) + e.GET("/*", StaticHandler) // Initial config middleware configured, err := system.Configured() diff --git a/test/assets/bindata.go b/test/assets/bindata.go index 6ce8090d1..41140f54b 100644 --- a/test/assets/bindata.go +++ b/test/assets/bindata.go @@ -1,6 +1,5 @@ -// Code generated by go-bindata. (@generated) DO NOT EDIT. - -//Package assets generated by go-bindata.// sources: +// Code generated by go-bindata. +// sources: // test/assets/bindata.go // test/assets/components/HC1.json // test/assets/components/HC10.json @@ -19,6 +18,8 @@ // test/assets/templates/test_template.odt // test/assets/templates/test_template2.odt // test/assets/test-tar.tar.gz +// DO NOT EDIT! + package assets import ( @@ -36,7 +37,7 @@ import ( func bindataRead(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) + return nil, fmt.Errorf("Read %q: %v", name, err) } var buf bytes.Buffer @@ -44,7 +45,7 @@ func bindataRead(data []byte, name string) ([]byte, error) { clErr := gz.Close() if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) + return nil, fmt.Errorf("Read %q: %v", name, err) } if clErr != nil { return nil, err @@ -65,32 +66,21 @@ type bindataFileInfo struct { modTime time.Time } -// Name return file name func (fi bindataFileInfo) Name() string { return fi.name } - -// Size return file size func (fi bindataFileInfo) Size() int64 { return fi.size } - -// Mode return file mode func (fi bindataFileInfo) Mode() os.FileMode { return fi.mode } - -// ModTime return file modify time func (fi bindataFileInfo) ModTime() time.Time { return fi.modTime } - -// IsDir return file whether a directory func (fi bindataFileInfo) IsDir() bool { - return fi.mode&os.ModeDir != 0 + return false } - -// Sys return file is sys mode func (fi bindataFileInfo) Sys() interface{} { return nil } @@ -110,7 +100,7 @@ func testAssetsBindataGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/bindata.go", size: 0, mode: os.FileMode(436), modTime: time.Unix(1649796608, 0)} + info := bindataFileInfo{name: "test/assets/bindata.go", size: 0, mode: os.FileMode(420), modTime: time.Unix(1677018476, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -130,7 +120,7 @@ func testAssetsComponentsHc1Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/components/HC1.json", size: 337, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/components/HC1.json", size: 337, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -150,7 +140,7 @@ func testAssetsComponentsHc10Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/components/HC10.json", size: 9833, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/components/HC10.json", size: 9833, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -170,7 +160,7 @@ func testAssetsComponentsHc11Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/components/HC11.json", size: 850, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/components/HC11.json", size: 850, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -190,7 +180,7 @@ func testAssetsComponentsHc12Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/components/HC12.json", size: 1583, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/components/HC12.json", size: 1583, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -210,7 +200,7 @@ func testAssetsComponentsHc2Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/components/HC2.json", size: 808, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/components/HC2.json", size: 808, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -230,7 +220,7 @@ func testAssetsComponentsHc3Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/components/HC3.json", size: 1421, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/components/HC3.json", size: 1421, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -250,7 +240,7 @@ func testAssetsComponentsHc5Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/components/HC5.json", size: 2021, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/components/HC5.json", size: 2021, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -270,7 +260,7 @@ func testAssetsComponentsHc7Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/components/HC7.json", size: 704, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/components/HC7.json", size: 704, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -290,7 +280,7 @@ func testAssetsComponentsHc8Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/components/HC8.json", size: 1310, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/components/HC8.json", size: 1310, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -310,7 +300,7 @@ func testAssetsComponentsHc9Json() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/components/HC9.json", size: 1474, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/components/HC9.json", size: 1474, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -330,7 +320,7 @@ func testAssetsImageJpg() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/image.jpg", size: 939, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/image.jpg", size: 939, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -350,7 +340,7 @@ func testAssetsTemplatesTest_expectedPdf() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/templates/test_expected.pdf", size: 8016, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/templates/test_expected.pdf", size: 8016, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -370,7 +360,7 @@ func testAssetsTemplatesTest_expected2Pdf() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/templates/test_expected2.pdf", size: 12178, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/templates/test_expected2.pdf", size: 12178, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -390,7 +380,7 @@ func testAssetsTemplatesTest_expected2_bPdf() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/templates/test_expected2_B.pdf", size: 8178, mode: os.FileMode(436), modTime: time.Unix(1649772107, 0)} + info := bindataFileInfo{name: "test/assets/templates/test_expected2_B.pdf", size: 8178, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -410,7 +400,7 @@ func testAssetsTemplatesTest_templateOdt() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/templates/test_template.odt", size: 8631, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/templates/test_template.odt", size: 8631, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -430,7 +420,7 @@ func testAssetsTemplatesTest_template2Odt() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/templates/test_template2.odt", size: 10525, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/templates/test_template2.odt", size: 10525, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil } @@ -450,7 +440,7 @@ func testAssetsTestTarTarGz() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "test/assets/test-tar.tar.gz", size: 225698, mode: os.FileMode(436), modTime: time.Unix(1644506510, 0)} + info := bindataFileInfo{name: "test/assets/test-tar.tar.gz", size: 225698, mode: os.FileMode(420), modTime: time.Unix(1677002340, 0)} a := &asset{bytes: bytes, info: info} return a, nil }