github.com/prebid/prebid-server/v2@v2.18.0/config/compression.go (about)

     1  package config
     2  
     3  import "github.com/prebid/prebid-server/v2/util/httputil"
     4  
     5  type Compression struct {
     6  	Request  CompressionInfo `mapstructure:"request"`
     7  	Response CompressionInfo `mapstructure:"response"`
     8  }
     9  
    10  // CompressionInfo defines what types of compression algorithms are supported.
    11  type CompressionInfo struct {
    12  	GZIP bool `mapstructure:"enable_gzip"`
    13  }
    14  
    15  func (cfg *CompressionInfo) IsSupported(contentEncoding httputil.ContentEncoding) bool {
    16  	switch contentEncoding.Normalize() {
    17  	case httputil.ContentEncodingGZIP:
    18  		return cfg.GZIP
    19  	}
    20  	return false
    21  }