Forum Discussion

Stephan_Jaeger_'s avatar
Stephan_Jaeger_
Icon for Nimbostratus rankNimbostratus
Apr 03, 2006

Unchunk HTTP Request Body

Hi,

 

 

im searching for a way to unchunk a http request body before sending it to the webserver which is unable to handle chunked reuqests. As both clients and servers are Appliances there is no way to configure either one for this situation and i want to avoid setting up an extra apache as reverse proxy.

 

 

Does anyone know a way to to this with iRules? Afaik our BigIP 6400 supports unchunking (at least in the GUI) only for the HTTP Response.

 

 

Regards

 

 

Stephan Jaeger
  • hoolio's avatar
    hoolio
    Icon for Cirrostratus rankCirrostratus
    From other posts on the site, I think this should do it for requests:

     

     

    when HTTP_REQUEST {

     

    don't allow data to be chunked

     

    if { [HTTP::version] eq "1.1" } {

     

    if { [HTTP::header is_keepalive] } {

     

    HTTP::header replace "Connection" "Keep-Alive"

     

    }

     

    HTTP::version "1.0"

     

    }

     

    }
  • Posted By hoolio on 4/03/2006 4:07 AM

     

     

    when HTTP_REQUEST {

     

    don't allow data to be chunked

     

    if { [HTTP::version] eq "1.1" } {

     

    if { [HTTP::header is_keepalive] } {

     

    HTTP::header replace "Connection" "Keep-Alive"

     

    }

     

    HTTP::version "1.0"

     

    }

     

    }

     

     

    Thanks for your reply. I already saw that post but i'm not sure if that will work.

     

    As i understand it this will change the request header to HTTP/1.0 so the server will send an HTTP/1.0 response. But what if this first request is an HTTP/1.1 POST with a chunked body? Just changing the protocol header won't fix anything, will it?

     

     

    I think the code you posted is from here:

     

    http://devcentral.f5.com/Default.aspx?tabid=29&articleType=ArticleView&articleId=25

     

     

    The description there says We also modify the request HTTP version to ensure that the response is not chunked.

     

     

    But my problem is that the request body needs to be unchunked, not (only) the response.

     

     

    Sadly i don't have the client appliance here right now so i have to wait until i can test this.

     

     

  • This works;-

     

     

    http://devcentral.f5.com/wiki/iRules.HTTP%20Request%20Unchunker.ashx

     

     

    Joanna