gin-contrib / gzip

Gin middleware to enable GZIP support.
MIT License
330 stars 87 forks source link

Chinese garbled #38

Open zuoRambo opened 4 years ago

zuoRambo commented 4 years ago

We used the master version but response body was Chinese garbled.

main.go

r := gin.Default()
r.Use(gzip.Gzip(gzip.DefaultCompression))

response body

{"errno":101000,"msg":"参数缺失 Key: 'RequestCommentInfo.ItemID' Error:Field validation for 'ItemID' failed on the 'required' tag"}
jianzhiyao commented 3 years ago

You should decode response body if Conetent-Encoding equals gzip