|
|
@ -30,6 +30,7 @@ import org.springframework.util.StringUtils;
|
|
|
|
* Properties for configuring {@link GzipFilter}.
|
|
|
|
* Properties for configuring {@link GzipFilter}.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
* @author Andy Wilkinson
|
|
|
|
|
|
|
|
* @author Stephane Nicoll
|
|
|
|
* @since 1.2.2
|
|
|
|
* @since 1.2.2
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@ConfigurationProperties(prefix = "spring.http.gzip")
|
|
|
|
@ConfigurationProperties(prefix = "spring.http.gzip")
|
|
|
@ -67,6 +68,11 @@ public class GzipFilterProperties {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private List<MimeType> mimeTypes;
|
|
|
|
private List<MimeType> mimeTypes;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Comma-separated list of MIME types to exclude from compression.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
private List<MimeType> excludedMimeTypes;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Comma-separated list of user agents to exclude from compression. String.contains is
|
|
|
|
* Comma-separated list of user agents to exclude from compression. String.contains is
|
|
|
|
* used to determine a match against the request's User-Agent header.
|
|
|
|
* used to determine a match against the request's User-Agent header.
|
|
|
@ -77,19 +83,19 @@ public class GzipFilterProperties {
|
|
|
|
* Comma-separated list of regular expression patterns to control user agents excluded
|
|
|
|
* Comma-separated list of regular expression patterns to control user agents excluded
|
|
|
|
* from compression.
|
|
|
|
* from compression.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private String excludedAgentPatterns;
|
|
|
|
private String excludeAgentPatterns;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Comma-separated list of paths to exclude from compression. Uses String.startsWith
|
|
|
|
* Comma-separated list of paths to exclude from compression. Uses String.startsWith
|
|
|
|
* to determine a match against the request's path.
|
|
|
|
* to determine a match against the request's path.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private String excludedPaths;
|
|
|
|
private String excludePaths;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Comma-separated list of regular expression patterns to control the paths that are
|
|
|
|
* Comma-separated list of regular expression patterns to control the paths that are
|
|
|
|
* excluded from compression.
|
|
|
|
* excluded from compression.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
private String excludedPathPatterns;
|
|
|
|
private String excludePathPatterns;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Vary header sent on responses that may be compressed.
|
|
|
|
* Vary header sent on responses that may be compressed.
|
|
|
@ -156,6 +162,16 @@ public class GzipFilterProperties {
|
|
|
|
this.mimeTypes = mimeTypes;
|
|
|
|
this.mimeTypes = mimeTypes;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<MimeType> getExcludedMimeTypes() {
|
|
|
|
|
|
|
|
return excludedMimeTypes;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setExcludedMimeTypes(List<MimeType> excludedMimeTypes) {
|
|
|
|
|
|
|
|
this.addInitParameter("excludedMimeTypes",
|
|
|
|
|
|
|
|
StringUtils.collectionToCommaDelimitedString(excludedMimeTypes));
|
|
|
|
|
|
|
|
this.excludedMimeTypes = excludedMimeTypes;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getExcludedAgents() {
|
|
|
|
public String getExcludedAgents() {
|
|
|
|
return this.excludedAgents;
|
|
|
|
return this.excludedAgents;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -165,31 +181,31 @@ public class GzipFilterProperties {
|
|
|
|
this.excludedAgents = excludedAgents;
|
|
|
|
this.excludedAgents = excludedAgents;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getExcludedAgentPatterns() {
|
|
|
|
public String getExcludeAgentPatterns() {
|
|
|
|
return this.excludedAgentPatterns;
|
|
|
|
return this.excludeAgentPatterns;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setExcludedAgentPatterns(String excludedAgentPatterns) {
|
|
|
|
public void setExcludeAgentPatterns(String excludeAgentPatterns) {
|
|
|
|
this.addInitParameter("excludedAgentPatterns", excludedAgentPatterns);
|
|
|
|
this.addInitParameter("excludeAgentPatterns", excludeAgentPatterns);
|
|
|
|
this.excludedAgentPatterns = excludedAgentPatterns;
|
|
|
|
this.excludeAgentPatterns = excludeAgentPatterns;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getExcludedPaths() {
|
|
|
|
public String getExcludePaths() {
|
|
|
|
return this.excludedPaths;
|
|
|
|
return this.excludePaths;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setExcludedPaths(String excludedPaths) {
|
|
|
|
public void setExcludePaths(String excludePaths) {
|
|
|
|
this.addInitParameter("excludedPaths", excludedPaths);
|
|
|
|
this.addInitParameter("excludePaths", excludePaths);
|
|
|
|
this.excludedPaths = excludedPaths;
|
|
|
|
this.excludePaths = excludePaths;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getExcludedPathPatterns() {
|
|
|
|
public String getExcludePathPatterns() {
|
|
|
|
return this.excludedPathPatterns;
|
|
|
|
return this.excludePathPatterns;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void setExcludedPathPatterns(String excludedPathPatterns) {
|
|
|
|
public void setExcludePathPatterns(String excludePathPatterns) {
|
|
|
|
this.addInitParameter("excludedPathPatterns", excludedPathPatterns);
|
|
|
|
this.addInitParameter("excludePathPatterns", excludePathPatterns);
|
|
|
|
this.excludedPathPatterns = excludedPathPatterns;
|
|
|
|
this.excludePathPatterns = excludePathPatterns;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String getVary() {
|
|
|
|
public String getVary() {
|
|
|
|