Forum Discussion

credmond_17919's avatar
credmond_17919
Icon for Nimbostratus rankNimbostratus
Feb 08, 2011

Request Body Manipulation for ICAP

Hi,

 

 

I'm wondering if someone can help with with a problem I am having with ICAP requests in BIG-IP. As you might know, ICAP REQMOD and RESPMOD requests wrap HTTP requests in their request body. I want to be able to examine the wrapped HTTP request and extract a particular header through an iRule.

 

 

 

Example ICAP request:

 

 

 

REQMOD /reqmod ICAP/1.0

 

Host: 127.0.0.1:8080

 

Date: Sat, 28 Nov 2010 15:04:01 GMT

 

 

 

GET http://www.somesite.com HTTP/1.1

 

Host: www.somesite.com

 

MyHeader: blah

 

Pragma: no-cache

 

 

 

 

In the above example I would like to example the ICAP Request body and extract the 'MyHeader' value.

 

 

 

The typical HTTP iRule commands let me manipulate the ICAP request and headers easily enough, but I am struggling, to find a clean way of manipulating Request body.

 

 

 

Any help would be much appreciated.

 

 

 

Thanks!

 

  • You can collect the HTTP payload and modify it or the request headers using HTTP::collect/HTTP::payload. Deb wrote a helpful article with examples of this using HTTP::retry:

     

     

    Conditioning iRule Logic on External Information - 01 - HTTP::retry

     

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

     

     

    Aaron
  • Thanks for the reply, hoolio. I had considered the HTTP:: collect and payload functionality for this scenario, but was wondering if there was any other options that I could look at?

     

     

    Thanks!
  • I can't think of anything else. Let us know how the testing goes. If you get stuck please post the iRule you're testing and debug logging you configure to /var/log/ltm. Else, if you get it working, it sounds like it would be a good Codeshare example :).

     

     

    Aaron