ASF Bugzilla – Attachment 34841 Details for
Bug 60852
Connector property compressableMimeType incorrectly spelled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Trivial patch for Tomcat 9
BZ-60852.patch (text/plain), 4.80 KB, created by
Michael Osipov
on 2017-03-17 17:18:15 UTC
(
hide
)
Description:
Trivial patch for Tomcat 9
Filename:
MIME Type:
Creator:
Michael Osipov
Created:
2017-03-17 17:18:15 UTC
Size:
4.80 KB
patch
obsolete
>Index: java/org/apache/coyote/http11/AbstractHttp11Protocol.java >=================================================================== >--- java/org/apache/coyote/http11/AbstractHttp11Protocol.java (revision 1787422) >+++ java/org/apache/coyote/http11/AbstractHttp11Protocol.java (working copy) >@@ -243,20 +243,20 @@ > } > > >- private String compressableMimeType = "text/html,text/xml,text/plain,text/css,text/javascript,application/javascript"; >- private String[] compressableMimeTypes = null; >- public String getCompressableMimeType() { return compressableMimeType; } >- public void setCompressableMimeType(String valueS) { >- compressableMimeType = valueS; >- compressableMimeTypes = null; >+ private String compressibleMimeType = "text/html,text/xml,text/plain,text/css,text/javascript,application/javascript"; >+ private String[] compressibleMimeTypes = null; >+ public String getCompressibleMimeType() { return compressibleMimeType; } >+ public void setCompressibleMimeType(String valueS) { >+ compressibleMimeType = valueS; >+ compressibleMimeTypes = null; > } >- public String[] getCompressableMimeTypes() { >- String[] result = compressableMimeTypes; >+ public String[] getCompressibleMimeTypes() { >+ String[] result = compressibleMimeTypes; > if (result != null) { > return result; > } > List<String> values = new ArrayList<>(); >- StringTokenizer tokens = new StringTokenizer(compressableMimeType, ","); >+ StringTokenizer tokens = new StringTokenizer(compressibleMimeType, ","); > while (tokens.hasMoreTokens()) { > String token = tokens.nextToken().trim(); > if (token.length() > 0) { >@@ -264,7 +264,7 @@ > } > } > result = values.toArray(new String[values.size()]); >- compressableMimeTypes = result; >+ compressibleMimeTypes = result; > return result; > } > >Index: java/org/apache/coyote/http11/Http11Processor.java >=================================================================== >--- java/org/apache/coyote/http11/Http11Processor.java (revision 1787422) >+++ java/org/apache/coyote/http11/Http11Processor.java (working copy) >@@ -206,7 +206,7 @@ > /** > * Check if the resource could be compressed, if the client supports it. > */ >- private boolean isCompressable() { >+ private boolean isCompressible() { > > // Check if content is not already gzipped > MessageBytes contentEncodingMB = response.getMimeHeaders().getValue("Content-Encoding"); >@@ -223,10 +223,10 @@ > // Check if sufficient length to trigger the compression > long contentLength = response.getContentLengthLong(); > if ((contentLength == -1) || (contentLength > protocol.getCompressionMinSize())) { >- // Check for compatible MIME-TYPE >- String[] compressableMimeTypes = protocol.getCompressableMimeTypes(); >- if (compressableMimeTypes != null) { >- return (startsWithStringArray(compressableMimeTypes, response.getContentType())); >+ // Check for compatible MIME type >+ String[] compressibleMimeTypes = protocol.getCompressibleMimeTypes(); >+ if (compressibleMimeTypes != null) { >+ return (startsWithStringArray(compressibleMimeTypes, response.getContentType())); > } > } > >@@ -864,11 +864,11 @@ > } > > // Check for compression >- boolean isCompressable = false; >+ boolean isCompressible = false; > boolean useCompression = false; > if (entityBody && (protocol.getCompressionLevel() > 0) && !sendingWithSendfile) { >- isCompressable = isCompressable(); >- if (isCompressable) { >+ isCompressible = isCompressible(); >+ if (isCompressible) { > useCompression = useCompression(); > } > // Change content-length to -1 to force chunking >@@ -921,7 +921,7 @@ > headers.setValue("Content-Encoding").setString("gzip"); > } > // If it might be compressed, set the Vary header >- if (isCompressable) { >+ if (isCompressible) { > // Make Proxies happy via Vary (from mod_deflate) > MessageBytes vary = headers.getValue("Vary"); > if (vary == null) { >Index: webapps/docs/config/http.xml >=================================================================== >--- webapps/docs/config/http.xml (revision 1787422) >+++ webapps/docs/config/http.xml (working copy) >@@ -347,7 +347,7 @@ > provider will be used.</p> > </attribute> > >- <attribute name="compressableMimeType" required="false"> >+ <attribute name="compressibleMimeType" required="false"> > <p>The value is a comma separated list of MIME types for which HTTP > compression may be used. > The default value is
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 60852
: 34841