• Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Major Major
    • None
    • 2.0.13.Final
    • Core, Servlet
    • None

      We have a JAX-RS endpoint deployed in Wildfly 14.0.1 which returns a simple JSON.

      Sometimes, the response body does not contain the JSON content, but the HTTP status and headers are written at the beginning of the response body.

      I'm going to clarify the problem with an example.

      This is the correct response stream:{}

      HTTP/1.1 200 OK 
      Connection: keep-alive 
      Content-Length: 156 
      Content-Type: application/json 
      Date: Tue, 10 Jan 2023 16:34:04 GMT  
      
      {"outcome":"0","description":"The service completed successfully","emsResult":{"outcomeCode":"0","outcomeDescription":"The service completed successfully"}}

      {}But sometimes this response is read:

      HTTP/1.1 200 OK 
      Connection: keep-alive 
      Content-Length: 156 
      Content-Type: application/json 
      Date: Tue, 10 Jan 2023 16:34:10 GMT  
      
      HTTP/1.1 200 OK 
      Connection: keep-alive 
      Content-Length: 156 
      Content-Type: application/json 
      Date: Tue, 10 Jan 2023 16:34:10 GMT
      mpleted successfully"}} 

      We verified the problem using tcpdump, in order to be sure that this is not a client reading problem, but the response above is actually produced by the server.

      It seems that when the response stream is written, the buffer is somehow reset and the body content is overwritten with the HTTP status and headers. Note that after the duplicated HTTP status and Headers there is the last part of the JSON.

      Thanks in advance.

       

       

            [UNDERTOW-2225] Response Body contains HTTP Status and headers

            antonio.derrico@tasgroup.it We are marking it as Cannot Reproduce for now. If you have further information to provide on latest WildFly/Unddertow, we will reopen it and have a look again. Thanks!

            Flavia Rainone added a comment - antonio.derrico@tasgroup.it We are marking it as Cannot Reproduce for now. If you have further information to provide on latest WildFly/Unddertow, we will reopen it and have a look again. Thanks!

            antonio.derrico@tasgroup.it well, first question - why 14? Most recent is 27, with main branch pushing 28th.
            So first thing would be to upgrade to most recent WFLY in order to check if its reproducible.

            Bartosz Baranowski added a comment - antonio.derrico@tasgroup.it well, first question - why 14? Most recent is 27, with main branch pushing 28th. So first thing would be to upgrade to most recent WFLY in order to check if its reproducible.

              rhn-cservice-bbaranow Bartosz Baranowski
              antonio.derrico@tasgroup.it Antonio D'Errico (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: