Uploaded image for project: 'RESTEasy'
  1. RESTEasy
  2. RESTEASY-173

Don't Content-Length of -1 on unbounded output

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • RC 1
    • Beta 6, Beta 7, Beta 8, Beta 9
    • None
    • None

      I'm testing resteasy for our rest-service communication. Very promising, and I look forward to the first official release. Since we're using Internet Explorer I ran into the following problem (Tested with beta-8, beta-9 and RC1. Code from RC1.):

      The org.jboss.resteasy.plugins.providers.AbstractEntityProvider always return length -1. This causes the Internet Explorer to discard the XML. These are the response headers (from Firebug):
      Content-Type text/xml;charset=utf-8
      Content-Length -1
      Connection close
      Server Jetty(7.0.0.pre5)

      If I leave the Content-Length to the webserver, and comment out line 441 and 442 in org.jboss.resteasy.core.SynchronousDispatcher:
      // long size = responseInvoker.getResponseSize();
      // response.getOutputHeaders().putSingle(HttpHeaderNames.CONTENT_LENGTH, String.valueOf(size));

      I get this response ::
      Content-Type text/xml;charset=utf-8
      Transfer-Encoding chunked
      Server Jetty(7.0.0.pre5)

      Now the xml works fine in both FF3 and IE7.

              patriot1burke@gmail.com Bill Burke (Inactive)
              patriot1burke@gmail.com Bill Burke (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: