Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-2340

RequestEncodingHandler does not update Content-Length after uncompressing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 2.3.10.Final
    • Core
    • None

      After upgrading to SpringBoot 3.2.x and SpringFramework 6.1.x the solution described here  to automatically decompress HTTP requests no longer worked as expected. 

      The final data when converted to String was truncated to the original length of the compressed data. 

      Details can be found in SF issue 30621

      The reason is that newer StringHttpMessageConverter implementation relies on {{ContentLength }}that is still reported with the original value even after  {{RequestEncodingHandler }}has decompressed the data (so Content Length should be updated accordingly). 

      I have posted a workaround as a SO answer that basically removes the "Content-Length" header from the HTTP request once data gets uncompressed.   A better solution may be implemented. 

       

       

              rhn-cservice-bbaranow Bartosz Baranowski
              fmiguelez Fernando Miguelez (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: