Forum Discussion

Erik_M_137433's avatar
Erik_M_137433
Icon for Nimbostratus rankNimbostratus
Feb 06, 2014

Strip User-Agent from incoming requests

I'm playing around in a lab, and I need to strip the User-Agent from incoming requests. The iRule I created goes like this:

 

when HTTP_REQUEST { { HTTP::header remove User-Agent } }

 

However, when I attempt to create the iRule, I receive this error:

 

1070151:3: Rule [/ISO2/app_strip_useragent] error: /ISO2/app_strip_useragent:2: error: [undefined procedure: HTTP::header remove User-Agent ][{ HTTP::header remove User-Agent }]

 

Any ideas? Seems to be a pretty simple task, but not sure why it's erroring out...

 

3 Replies

  • Too many brackets. Try this

    when HTTP_REQUEST { 
     HTTP::header remove User-Agent  
    }
    
  • nathe's avatar
    nathe
    Icon for Cirrocumulus rankCirrocumulus

    Or it can be done using a http profile on the virtual server.

     

  • Arie's avatar
    Arie
    Icon for Altostratus rankAltostratus

    As of version 11.4.0 HTTP Profile functionality this is handled by the Local Traffic Policies feature. (http://support.f5.com/kb/en-us/solutions/public/14000/400/sol14409.html)