3030 * Properties for configuring {@link GzipFilter}.
3131 *
3232 * @author Andy Wilkinson
33+ * @author Stephane Nicoll
3334 * @since 1.2.2
3435 */
3536@ ConfigurationProperties (prefix = "spring.http.gzip" )
@@ -67,6 +68,11 @@ public class GzipFilterProperties {
6768 */
6869 private List <MimeType > mimeTypes ;
6970
71+ /**
72+ * Comma-separated list of MIME types to exclude from compression.
73+ */
74+ private List <MimeType > excludedMimeTypes ;
75+
7076 /**
7177 * Comma-separated list of user agents to exclude from compression. String.contains is
7278 * used to determine a match against the request's User-Agent header.
@@ -77,19 +83,19 @@ public class GzipFilterProperties {
7783 * Comma-separated list of regular expression patterns to control user agents excluded
7884 * from compression.
7985 */
80- private String excludedAgentPatterns ;
86+ private String excludeAgentPatterns ;
8187
8288 /**
8389 * Comma-separated list of paths to exclude from compression. Uses String.startsWith
8490 * to determine a match against the request's path.
8591 */
86- private String excludedPaths ;
92+ private String excludePaths ;
8793
8894 /**
8995 * Comma-separated list of regular expression patterns to control the paths that are
9096 * excluded from compression.
9197 */
92- private String excludedPathPatterns ;
98+ private String excludePathPatterns ;
9399
94100 /**
95101 * Vary header sent on responses that may be compressed.
@@ -156,6 +162,16 @@ public void setMimeTypes(List<MimeType> mimeTypes) {
156162 this .mimeTypes = mimeTypes ;
157163 }
158164
165+ public List <MimeType > getExcludedMimeTypes () {
166+ return excludedMimeTypes ;
167+ }
168+
169+ public void setExcludedMimeTypes (List <MimeType > excludedMimeTypes ) {
170+ this .addInitParameter ("excludedMimeTypes" ,
171+ StringUtils .collectionToCommaDelimitedString (excludedMimeTypes ));
172+ this .excludedMimeTypes = excludedMimeTypes ;
173+ }
174+
159175 public String getExcludedAgents () {
160176 return this .excludedAgents ;
161177 }
@@ -165,31 +181,31 @@ public void setExcludedAgents(String excludedAgents) {
165181 this .excludedAgents = excludedAgents ;
166182 }
167183
168- public String getExcludedAgentPatterns () {
169- return this .excludedAgentPatterns ;
184+ public String getExcludeAgentPatterns () {
185+ return this .excludeAgentPatterns ;
170186 }
171187
172- public void setExcludedAgentPatterns (String excludedAgentPatterns ) {
173- this .addInitParameter ("excludedAgentPatterns " , excludedAgentPatterns );
174- this .excludedAgentPatterns = excludedAgentPatterns ;
188+ public void setExcludeAgentPatterns (String excludeAgentPatterns ) {
189+ this .addInitParameter ("excludeAgentPatterns " , excludeAgentPatterns );
190+ this .excludeAgentPatterns = excludeAgentPatterns ;
175191 }
176192
177- public String getExcludedPaths () {
178- return this .excludedPaths ;
193+ public String getExcludePaths () {
194+ return this .excludePaths ;
179195 }
180196
181- public void setExcludedPaths (String excludedPaths ) {
182- this .addInitParameter ("excludedPaths " , excludedPaths );
183- this .excludedPaths = excludedPaths ;
197+ public void setExcludePaths (String excludePaths ) {
198+ this .addInitParameter ("excludePaths " , excludePaths );
199+ this .excludePaths = excludePaths ;
184200 }
185201
186- public String getExcludedPathPatterns () {
187- return this .excludedPathPatterns ;
202+ public String getExcludePathPatterns () {
203+ return this .excludePathPatterns ;
188204 }
189205
190- public void setExcludedPathPatterns (String excludedPathPatterns ) {
191- this .addInitParameter ("excludedPathPatterns " , excludedPathPatterns );
192- this .excludedPathPatterns = excludedPathPatterns ;
206+ public void setExcludePathPatterns (String excludePathPatterns ) {
207+ this .addInitParameter ("excludePathPatterns " , excludePathPatterns );
208+ this .excludePathPatterns = excludePathPatterns ;
193209 }
194210
195211 public String getVary () {
0 commit comments