压缩匹配条件时也检查请求条件

This commit is contained in:
刘祥超
2021-09-29 20:11:54 +08:00
parent 04f47fe8ed
commit bfa672dd37

View File

@@ -151,6 +151,9 @@ func (this *HTTPCompressionConfig) MaxBytes() int64 {
// MatchResponse 是否匹配响应 // MatchResponse 是否匹配响应
func (this *HTTPCompressionConfig) MatchResponse(mimeType string, contentLength int64, requestExt string, formatter shared.Formatter) bool { func (this *HTTPCompressionConfig) MatchResponse(mimeType string, contentLength int64, requestExt string, formatter shared.Formatter) bool {
if this.Conds != nil && formatter != nil { if this.Conds != nil && formatter != nil {
if !this.Conds.MatchRequest(formatter) {
return false
}
if !this.Conds.MatchResponse(formatter) { if !this.Conds.MatchResponse(formatter) {
return false return false
} }