Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-18434

[GSS](7.3.z) EAP Undertow Transfer Encoding : chunked setting does not set chunk size and chunk trailer marks

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • 7.0.0.GA, 7.1.0.GA, 7.2.0.GA, 7.2.5.GA
    • Undertow
    • Hide

      None

      Show
      None
    • Hide
      • We have attached an example Rest WS to reproduce the issue.
      • First update your standalone.xml to display the Request and Response
      <subsystem xmlns="urn:jboss:domain:undertow:7.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" instance-id="cjde_worker01" default-security-domain="other">
                  <buffer-cache name="default"/>
                  <server name="default-server">
                      ...........................
                      <host name="default-host" alias="localhost">
                          <filter-ref name="proxy-setup" priority="1"/>
                          <filter-ref name="proxy-peer-address" priority="10"/>
      .....................
      		    <access-log pattern="%h %l %u %t &quot;%r&quot; %s %b &quot;%{i,Referer}&quot; &quot;%{i,User-Agent}&quot; Cookie: &quot;%{i,COOKIE}&quot; Set-Cookie: &quot;%{o,SET-COOKIE}&quot; SessionID: %S Thread: &quot;%I&quot; TimeTaken: %T"/>
                          <filter-ref name="server-header"/>
                          <filter-ref name="x-powered-by-header"/>
                          <filter-ref name="requestDumperExpression"/>
      
                          ..................
                      </host>
                  </server>
                  <servlet-container name="default">
                      ...........
                  </servlet-container>
                  <filters>
                      .........................
      		<response-header name="server-header" header-name="Server" header-value="JBoss-EAP/7"/>
                      <response-header name="x-powered-by-header" header-name="X-Powered-By" header-value="Undertow/1"/>
                      <expression-filter name="requestDumperExpression" expression="dump-request"/>
      ..................
      
                  </filters>
              </subsystem>
      
      
      
      1. Then build and run the deployed WS
      running 
      
      http://localhost:8080/demo/api/one/getData/10
      This will run successfully and no Transfer Encoding chunked is set by undertow
      
      http://localhost:8080/demo/api/one/getData/16
      This will run successfully and not Transfer Encoding chunked is set. by undertow
      Transfer Encoding : chunked is set but no chunk size or trailers are set.
      You can capture the network packets and examine.
      
      ----------------------------REQUEST---------------------------
                     URI=/demo/api/one/getData/16
       characterEncoding=null
           contentLength=-1
             contentType=null
                  header=Accept=text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
                  header=Accept-Language=en-US,en;q=0.9
                  header=Accept-Encoding=gzip, deflate, br
                  header=Sec-Fetch-Mode=navigate
                  header=User-Agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36
                  header=Sec-Fetch-User=?1
                  header=Connection=keep-alive
                  header=Sec-Fetch-Site=none
                  header=Upgrade-Insecure-Requests=1
                  header=Host=localhost:8080
                  locale=[en_US, en]
                  method=GET
                protocol=HTTP/1.1
             queryString=
              remoteAddr=/127.0.0.1:47194
              remoteHost=pwere.remote.csb
                  scheme=http
                    host=localhost:8080
              serverPort=8080
                isSecure=false
      --------------------------RESPONSE--------------------------
           contentLength=-1
             contentType=text/html;charset=UTF-8
                  header=Connection=keep-alive
                  header=X-Powered-By=Undertow/1
                  header=Server=JBoss-EAP/7
                  header=Transfer-Encoding=chunked
                  header=Content-Type=text/html;charset=UTF-8
                  header=Date=Tue, 07 Jan 2020 19:26:26 GMT
                  status=200
      
      ==============================================================
      
      
      Request URL: http://localhost:8080/demo/api/one/getData/16
      Request Method: GET
      Status Code: 200 OK
      Remote Address: 127.0.0.1:8080
      Referrer Policy: no-referrer-when-downgrade
      Connection: keep-alive
      Content-Type: text/html;charset=UTF-8
      Date: Tue, 07 Jan 2020 19:26:26 GMT
      Server: JBoss-EAP/7
      Transfer-Encoding: chunked
      X-Powered-By: Undertow/1
      Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
      Accept-Encoding: gzip, deflate, br
      Accept-Language: en-US,en;q=0.9
      Connection: keep-alive
      Host: localhost:8080
      Sec-Fetch-Mode: navigate
      Sec-Fetch-Site: none
      Sec-Fetch-User: ?1
      Upgrade-Insecure-Requests: 1
      User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36
      
      
      Show
      We have attached an example Rest WS to reproduce the issue. First update your standalone.xml to display the Request and Response <subsystem xmlns= "urn:jboss:domain:undertow:7.0" default -server= " default -server" default -virtual-host= " default -host" default -servlet-container= " default " instance-id= "cjde_worker01" default -security-domain= "other" > <buffer-cache name= " default " /> <server name= " default -server" > ........................... <host name= " default -host" alias= "localhost" > <filter-ref name= "proxy-setup" priority= "1" /> <filter-ref name= "proxy-peer-address" priority= "10" /> ..................... <access-log pattern= "%h %l %u %t &quot;%r&quot; %s %b &quot;%{i,Referer}&quot; &quot;%{i,User-Agent}&quot; Cookie: &quot;%{i,COOKIE}&quot; Set-Cookie: &quot;%{o,SET-COOKIE}&quot; SessionID: %S Thread : &quot;%I&quot; TimeTaken: %T" /> <filter-ref name= "server-header" /> <filter-ref name= "x-powered-by-header" /> <filter-ref name= "requestDumperExpression" /> .................. </host> </server> <servlet-container name= " default " > ........... </servlet-container> <filters> ......................... <response-header name= "server-header" header-name= "Server" header-value= "JBoss-EAP/7" /> <response-header name= "x-powered-by-header" header-name= "X-Powered-By" header-value= "Undertow/1" /> <expression-filter name= "requestDumperExpression" expression= "dump-request" /> .................. </filters> </subsystem> Then build and run the deployed WS running http://localhost:8080/demo/api/one/getData/10 This will run successfully and no Transfer Encoding chunked is set by undertow http://localhost:8080/demo/api/one/getData/16 This will run successfully and not Transfer Encoding chunked is set. by undertow Transfer Encoding : chunked is set but no chunk size or trailers are set. You can capture the network packets and examine. ----------------------------REQUEST--------------------------- URI=/demo/api/one/getData/16 characterEncoding= null contentLength=-1 contentType= null header=Accept=text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 header=Accept-Language=en-US,en;q=0.9 header=Accept-Encoding=gzip, deflate, br header=Sec-Fetch-Mode=navigate header=User-Agent=Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36 header=Sec-Fetch-User=?1 header=Connection=keep-alive header=Sec-Fetch-Site=none header=Upgrade-Insecure-Requests=1 header=Host=localhost:8080 locale=[en_US, en] method=GET protocol=HTTP/1.1 queryString= remoteAddr=/127.0.0.1:47194 remoteHost=pwere.remote.csb scheme=http host=localhost:8080 serverPort=8080 isSecure= false --------------------------RESPONSE-------------------------- contentLength=-1 contentType=text/html;charset=UTF-8 header=Connection=keep-alive header=X-Powered-By=Undertow/1 header=Server=JBoss-EAP/7 header=Transfer-Encoding=chunked header=Content-Type=text/html;charset=UTF-8 header=Date=Tue, 07 Jan 2020 19:26:26 GMT status=200 ============================================================== Request URL: http: //localhost:8080/demo/api/one/getData/16 Request Method: GET Status Code: 200 OK Remote Address: 127.0.0.1:8080 Referrer Policy: no-referrer-when-downgrade Connection: keep-alive Content-Type: text/html;charset=UTF-8 Date: Tue, 07 Jan 2020 19:26:26 GMT Server: JBoss-EAP/7 Transfer-Encoding: chunked X-Powered-By: Undertow/1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9 Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9 Connection: keep-alive Host: localhost:8080 Sec-Fetch-Mode: navigate Sec-Fetch-Site: none Sec-Fetch-User: ?1 Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.79 Safari/537.36

    Description

      When running a Rest WS built using RestEasy it was found that after the response reaches a certain size over 16kb undertow will set the Transfer encoding as chunked but not set chunk size and chunk trailer. The causes downstream systems to fail when trying to consume the chunked responses.

      This appears to be in violation of RFC2616 EAP and it's because EAP isn't sending the chunk size indicator per RFC2616

      https://tools.ietf.org/html/rfc2616#section-3.6.1

      Attachments

        Issue Links

          Activity

            People

              flaviarnn Flavia Rainone
              rhn-support-pwere Paul Were (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: