Forum Discussion

Sridhar_111831's avatar
Sridhar_111831
Icon for Nimbostratus rankNimbostratus
Mar 03, 2016

HTTP::collect does not working for http response that is chunked

We have irule using http::collect and only when the response data is chunked, F5 does not respond back to client even when the chunking is disabled in http profile.

 

When we issue http connection:close in HTTP REQUEST or disable collect all works fine. I'm trying to find why the http::collect would not work along with chunking.

 

I noticed that all articles in devcentral suggest to disable chunking before using http::collect. No idea why? pls advise..

 

-Sri

 

3 Replies

  • how much data do you want to collect? if whole data, what length will you use when response is sent in chunk?

    Also, if you use HTTP::collect without specifying a length, you must have some non-HTTP event (e.g. AUTH_RESULT or NAME_RESOLVED) run HTTP::release, or HTTP processing will not continue, and the collected data will be discarded when the connection times out.

    HTTP::collect wiki

    https://devcentral.f5.com/wiki/iRules.HTTP__collect.ashx
  • Hi Sridhar,

     

    you may try the iRule code below and see if its solving your issue. It helped me already in different chucking related issues (e.g. problems in combination with STREAM and Compression) and hopefully in your case too.

     

    when HTTP_RESPONSE {
        if [HTTP::header exists "Transfer-encoding"] {
            HTTP::payload rechunk
        }
    }

    Cheers, Kai

     

  • Does an incoming request contain HTTP header:

    Accept-Encoding
    i.e.
    Accept-Encoding: gzip, deflate
    ? You may also have issues with payload search & replace functions if end-server responds with compressed content. Note that you can still compress on the clientside (i.e. use HTTP Compression profile), but the serverside content must remain uncompressed.

    Try the following:

    when HTTP_REQUEST {
    
      if { [HTTP::header exists "Accept-Encoding"]}{
        HTTP::header remove Accept-Encoding
      }
       ... The rest of your iRule
    
    }