Uploaded image for project: 'TorqueBox'
  1. TorqueBox
  2. TORQUE-978

Rails streamed responses come out double-chunk encoded

    Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.1.2
    • Fix Version/s: 2.2.0
    • Component/s: None
    • Labels:
      None

      Description

      I am seeing double chunk encoded responses when using Rails streaming. Here's the source as shown by Chrome:

      10
      <!DOCTYPE html>
      
      c
      <html class=
      39
      "theme-dusk userNotSignedIn  notGalleryOwner monoGallery"
      38
       style="background-color:#2a2a2a">
        <head>
          <title>
      
      8
              
      13
      EVERYTHING by frodo
      1
      
      
      16
          </title>
          
          
      89
      <meta content="authenticity_token" name="csrf-param" />
      <meta content="3nMEeK+pgqR1CScUiSciX9ZEoyZPRsll9u2/NKR7CgM=" name="csrf-token" />
      1
      
      
      1b2
          
          <meta name='viewport' content='width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0'>
          <meta name='apple-mobile-web-app-capable' content='yes'>
          <meta http-equiv='cleartype' content='on'>
          <meta http-equiv='X-UA-Compatible' content='IE=edge;chrome=1'>
          <link rel='shortcut icon' href='/favicon.ico'>
          <link rel='apple-touch-icon' href='/apple-touch-icon.png'>
          
          
      
      21
            <link rel="canonical" href=
      1f
      "http://frodo.tim1.jux.nu:8080"
      2
      >
      
      1
      

      Notice the visible chunk markers. And the Transfer-Encoding header appears twice:

      Transfer-Encoding:chunked
      Transfer-Encoding:chunked
      

      I'm pretty sure this is the same problem as https://github.com/jruby/jruby-rack/issues/117 . In which case, this is triggered when the response is greater than Tomcat's buffer size and Tomcat chunk encodes (on top of Rails' chunk encoding).

      I suspect the integration test at https://github.com/torquebox/torquebox/commit/4ea390dbb361dead0514b8b2e8731b3bacbb1931 is using a response which is smaller than the buffer size.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                benbrowning Ben Browning
                Reporter:
                tolsen Tim Olsen
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: