mirror of
https://github.com/alibaba/higress.git
synced 2026-04-22 04:27:26 +08:00
feat(gzip): add gzip configuration support and update default settings (#2867)
Co-authored-by: 澄潭 <zty98751@alibaba-inc.com>
This commit is contained in:
@@ -144,7 +144,7 @@ func deepCopyGzip(gzip *Gzip) (*Gzip, error) {
|
||||
|
||||
func NewDefaultGzip() *Gzip {
|
||||
gzip := &Gzip{
|
||||
Enable: false,
|
||||
Enable: true,
|
||||
MinContentLength: 1024,
|
||||
ContentType: []string{"text/html", "text/css", "text/plain", "text/xml", "application/json", "application/javascript", "application/xhtml+xml", "image/svg+xml"},
|
||||
DisableOnEtagHeader: true,
|
||||
|
||||
@@ -374,7 +374,7 @@ func TestGzipController_AddOrUpdateHigressConfig(t *testing.T) {
|
||||
new: &HigressConfig{
|
||||
Gzip: &Gzip{
|
||||
Enable: true,
|
||||
MinContentLength: 1024,
|
||||
MinContentLength: 2048, // Changed from 1024 to make it different from default
|
||||
ContentType: []string{"text/html", "text/css", "text/plain", "text/xml", "application/json", "application/javascript", "application/xhtml+xml", "image/svg+xml"},
|
||||
DisableOnEtagHeader: true,
|
||||
MemoryLevel: 5,
|
||||
@@ -388,7 +388,7 @@ func TestGzipController_AddOrUpdateHigressConfig(t *testing.T) {
|
||||
wantEventPush: "push",
|
||||
wantGzip: &Gzip{
|
||||
Enable: true,
|
||||
MinContentLength: 1024,
|
||||
MinContentLength: 2048, // Changed from 1024 to make it different from default
|
||||
ContentType: []string{"text/html", "text/css", "text/plain", "text/xml", "application/json", "application/javascript", "application/xhtml+xml", "image/svg+xml"},
|
||||
DisableOnEtagHeader: true,
|
||||
MemoryLevel: 5,
|
||||
|
||||
Reference in New Issue
Block a user