forked from forgejo/forgejo
[GITEA] Use maintained gziphandler
- https://github.com/NYTimes/gziphandler doesn't seems to be maintained anymore and Forgejo already includes https://github.com/klauspost/compress which provides a maintained and faster gzip handler fork. - Enables Jitter to prevent BREACH attacks, as this *seems* to be possible in the context of Forgejo. (cherry picked from commitcc2847241d
) (cherry picked from commit99ba56a876
) Conflicts: go.sum https://codeberg.org/forgejo/forgejo/pulls/1581 (cherry picked from commit711638193d
) (cherry picked from commit9c12a37fde
) (cherry picked from commitd130653454
) (cherry picked from commit45a16f8c3c
) (cherry picked from commita497acb31f
) (cherry picked from commitfe87fd8289
)
This commit is contained in:
parent
b9a3e1e525
commit
6ac12e6693
6 changed files with 23 additions and 21 deletions
|
@ -18,9 +18,9 @@ import (
|
|||
"code.gitea.io/gitea/modules/json"
|
||||
"code.gitea.io/gitea/modules/lfs"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/routers/web"
|
||||
"code.gitea.io/gitea/tests"
|
||||
|
||||
"github.com/klauspost/compress/gzhttp"
|
||||
gzipp "github.com/klauspost/compress/gzip"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
@ -132,7 +132,7 @@ func TestGetLFSSmallTokenFail(t *testing.T) {
|
|||
|
||||
func TestGetLFSLarge(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
content := make([]byte, web.GzipMinSize*10)
|
||||
content := make([]byte, gzhttp.DefaultMinSize*10)
|
||||
for i := range content {
|
||||
content[i] = byte(i % 256)
|
||||
}
|
||||
|
@ -143,7 +143,7 @@ func TestGetLFSLarge(t *testing.T) {
|
|||
|
||||
func TestGetLFSGzip(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
b := make([]byte, web.GzipMinSize*10)
|
||||
b := make([]byte, gzhttp.DefaultMinSize*10)
|
||||
for i := range b {
|
||||
b[i] = byte(i % 256)
|
||||
}
|
||||
|
@ -159,7 +159,7 @@ func TestGetLFSGzip(t *testing.T) {
|
|||
|
||||
func TestGetLFSZip(t *testing.T) {
|
||||
defer tests.PrepareTestEnv(t)()
|
||||
b := make([]byte, web.GzipMinSize*10)
|
||||
b := make([]byte, gzhttp.DefaultMinSize*10)
|
||||
for i := range b {
|
||||
b[i] = byte(i % 256)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue