Forum Discussion

Rene_C_'s avatar
Rene_C_
Icon for Nimbostratus rankNimbostratus
Nov 20, 2014

Stream::replace not updating content-length

Hi,

i had a new integration where i needed to do some content rewriting in the responses from the server. This generally works good enough with stream::replace, though it seems that the content-length header is not correctly updated.

For now i've set the Response Chunking to Re-Chunk in the http-profile, though as far as i know, this should've already been fixed long ago:

"On LTM versions prior to 9.4, if the HTTP content length may change as a result of the stream replacement, you must enable a HTTP profile with Response Chunking set to Re-chunk to accommodate the content length change on the fly. Otherwise, LTM will forward the now-incorrect Content-Length header, which can cause the browser to hang, display partial pages, or otherwise act funky."

I can reproduce this issue on 11.4 and 11.5.1.

Any ideas what could possibly go wrong?

Cheers, Rene

2 Replies

  • i do see there is a bug on stream profile and content-length header but it seems stream irule has no issue. since you can reproduce it, can you open a support case to verify?

     

  • I'm having a similar situation here loadbalancing a Java-based application. After applying a stream iRule that's working well, there happens to be an issue with the Content-length value in the Http-Response packet.

    When the same HTTP Request is send on backend connection, backend server is responding with the 'Content-Length' field in the header but the same response is send to the end client by the BigIP as chunks:

    /forms/lservlet;jsessionid=PmyvXQFhynT7w8sYFNDyvtq1pCGQhnptbRnLc43D2Bf1TlNHp5Ws!1431838774
    
    Request/response on frontend connection:
    BigIP is sending response to the end-client using chunks.
    GET /forms/frmservlet?config=ref&serveruserparams=NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256&otherparams=P_WST_LAN_IND=1+P_BANKS_APP_URL=http://10.10.1.57:9001/banks&ifsessid=WLS_FORMS.formsapp.130&acceptLanguage=en-US,en;q=0.5&ifcmd=startsession&iflocale=en-US HTTP/1.1
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Mozilla/4.0 (Windows 10 10.0) Java/1.8.0_77
    Host: 10.10.1.57:9001
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-alive
    Cookie: JSESSIONID=gst7XQGF1yrVxH8JvTlQf2VbxNv7PGyTyXkCCfJMNnVSS9Nhvn1T!1431838774
    
    HTTP/1.1 200 OK
    Cache-Control: no-cache,no-store
    Date: Thu, 21 Jul 2016 12:52:10 GMT
    Content-Type: text/plain
    X-ORACLE-DMS-ECID: 0000LODWqKTF^6^5xVP5iW1NZWFi000MFK
    X-Powered-By: Servlet/2.5 JSP/2.1
    Transfer-Encoding: chunked
    
    5a
    /forms/lservlet;jsessionid=PmyvXQFhynT7w8sYFNDyvtq1pCGQhnptbRnLc43D2Bf1TlNHp5Ws!1431838774
    0
    

    In working scenario when traffic is sent directly to the pool member (bypassing the load balancer), server responds to the client with un-chunked content.

    It appears that the Java application requires Content-Length value to be correct and present in HTTP response received on the client-end.

    Here is my question:Is there an iRule to find the correct Content-Length value and insert into the Response Header?

    I should add that I also have the Rechunk Response set to RECHUNK on the http profile