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

Chunked Responses Invalid Until Next Chunk Written

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 1.0.4.Final, 1.1.Beta1
    • 1.0.2.Final
    • None
    • None

      When testing a SockJS server implementation on top of Undertow, I ran across an issue in their test suite of the "xhr_streaming" protocol where Undertow is sending the chunks of a chunked response without the trailing CRLF of each chunk. Instead, that trailing CRLF is being sent as a prefix to the subsequent chunk.

      This breaks the expectations of the SockJS client and probably other clients that rely on streaming chunks over HTTP. This also appears to violate the HTTP spec at http://tools.ietf.org/html/rfc2616#section-3.6.1 where it explicitly states that a chunk is comprised of:

      chunk = chunk-size [ chunk-extension ] CRLF
              chunk-data CRLF
      

      The final CRLF in that chunk is what's being left off until the next chunk of data is sent. It instead should be sent with the current chunk.

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              bbrownin@redhat.com Ben Browning
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: