Tapestry 5
  1. Tapestry 5
  2. TAP5-1241

Setting the content length of the response should automatically disable response compression

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.1.0.4
    • Fix Version/s: 5.2.1
    • Component/s: tapestry-core
    • Labels:
      None

      Description

      If if you have Dispatcher (or something else) that generates a response and call response.setContentLength() on a text/* mime type the resulting response content length does not match the length of the actual response. This is due to that you set the content length for the uncompressed content and the response is intercepted and gzipped but the original length is still set. In firefox and IE this doesn't appear to be a problem. Chrome however will simply not load stylesheets where this occurs.

      If something like GZipFilter is going to automatically gzip the response it should also change the content length to reflect the new response length.

      The workaround at the moment is simply not setting a content length.

      This may very well effect future versions; I couldn't find an existing ticket though.

        Issue Links

          Activity

          Dan Adams created issue -
          Howard M. Lewis Ship made changes -
          Field Original Value New Value
          Assignee Howard M. Lewis Ship [ hlship ]
          Howard M. Lewis Ship made changes -
          Link This issue is related to TAP5-1236 [ TAP5-1236 ]
          Hide
          Howard M. Lewis Ship added a comment -

          I'm not really sure how to address this, beyond TAP5-1236 which allows your code to disable compression easier. In the existing code base, the only code that invokes setContentLength() is related to assets (and virtual JavaScript assets) and always does a disableCompression() (and sets the content length to the right length, regardless of whether using compression or not).

          Perhaps setting a content length should disable compression automatically?

          Show
          Howard M. Lewis Ship added a comment - I'm not really sure how to address this, beyond TAP5-1236 which allows your code to disable compression easier. In the existing code base, the only code that invokes setContentLength() is related to assets (and virtual JavaScript assets) and always does a disableCompression() (and sets the content length to the right length, regardless of whether using compression or not). Perhaps setting a content length should disable compression automatically?
          Howard M. Lewis Ship made changes -
          Summary Automatic gzipping does not allow setting a content length for generated content Setting the content length of the response should automatically disable response compression
          Hide
          Howard M. Lewis Ship added a comment -

          Ok, decided to go that route.

          Show
          Howard M. Lewis Ship added a comment - Ok, decided to go that route.
          Howard M. Lewis Ship made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Fix Version/s 5.2.1 [ 12315230 ]
          Resolution Fixed [ 1 ]
          Hide
          Hudson added a comment -

          Integrated in tapestry-5.2-freestyle #183 (See https://hudson.apache.org/hudson/job/tapestry-5.2-freestyle/183/)
          TAP5-1241: Setting the content length of the response should automatically disable response compression

          Show
          Hudson added a comment - Integrated in tapestry-5.2-freestyle #183 (See https://hudson.apache.org/hudson/job/tapestry-5.2-freestyle/183/ ) TAP5-1241 : Setting the content length of the response should automatically disable response compression

            People

            • Assignee:
              Howard M. Lewis Ship
              Reporter:
              Dan Adams
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development