Mantis - Resin
Viewing Issue Advanced Details
1087 minor always 05-05-06 08:25 06-28-06 19:48
ferg  
ferg  
normal  
closed 3.0.18  
fixed  
none    
none 3.0.20  
0001087: gzip issues with changing status code
(rep by Frank Nestel)


The "offending" code from our perspective is within
GzipFilter$GzipResponse
in the following two methods:

    /**
     * If the status changes, need to disable the response.
     */
    public void setStatus(int status, String message)
    {
      super.setStatus(status, message);

      if (_gzipStream != null) {
    _gzipStream.setEnable(false);
    _response.setHeader("Content-Encoding", "plain");
      }

      _allowGzip = false;
    }
    /**
     * If the status changes, need to disable the response.
     */
    public void setStatus(int status)
    {
      super.setStatus(status);

      if (_gzipStream != null) {
    _gzipStream.setEnable(false);
    _response.setHeader("Content-Encoding", "plain");
      }

      _allowGzip = false;
    }

We have an application which generates both, lots of 410 status codes
and 301's. With the original Resin Gzip code the 410 pages get detroyed
since unfortunately the decision that a page is 410 and not 200 can
only be done after 80% of the JSP code is allready processed and there
is allready much html burried somewhere in the _gzipStream, not yet send

to the client. On the other hand if we simply
remove above two methods (which then reduces them to the corresponding
super.setStatus(...)-APIs) the 410 work fine. But then it turns
out that the 301 responses are not properly handled by M$ Internet
Explorer any more. For now we're stuck with not using GZipFilter which
is not really what we wanted.

Notes
(0001353)
ferg   
06-28-06 19:48   
server/1087