On 12/08/2014 00:14, Konstantin Kolinko wrote:
> 2014-08-04 21:22 GMT+04:00 <[email protected]>:
>> Author: markt
>> Date: Mon Aug 4 17:22:01 2014
>> New Revision: 1615697
>>
>> URL: http://svn.apache.org/r1615697
>> Log:
>> When the gzip option is enabled for the DefaultServlet ensure that a
>> suitable Vary header is returned for resources that might be returned
>> directly in compressed form.
>>
>> Modified:
>> tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
>> tomcat/trunk/webapps/docs/changelog.xml
>>
>> Modified: tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
>> URL:
>> http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java?rev=1615697&r1=1615696&r2=1615697&view=diff
>> ==============================================================================
>> --- tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java
>> (original)
>> +++ tomcat/trunk/java/org/apache/catalina/servlets/DefaultServlet.java Mon
>> Aug 4 17:22:01 2014
>> @@ -799,16 +799,15 @@ public class DefaultServlet extends Http
>>
>> // Serve a gzipped version of the file if present
>> boolean usingGzippedVersion = false;
>> - if (gzip &&
>> - resource.isFile() &&
>> - !included &&
>
> 1). I do get why "!included" check was moved to the place below. I
> think it should not be moved.
>
> I think that "included" flag does not depend on "accept-encoding"
> value sent by user.
Agreed. Fixed.
> 2). There may already be a Vary header in the response.
Agreed. A filter could set one. This has been fixed too.
> 3) The code may check response.isCommitted(). (In other words, that
> addHeader("Content-Encoding", "gzip")
> call has been successful).
Is that necessary? It isn't something we check anywhere else in the
DefaultServlet (and I am not aware of any problems in that area).
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]