Forum Discussion

Aviv's avatar
Aviv
Icon for Cirrus rankCirrus
Jan 05, 2016

Apm insert http header

Hi!

 

i need to insert some http header name and value to a web page. how do i do it ? i tried by irule and it's not working.(the irule is connected to the vs)

 

when i use fiddler to insert the http header it's working.

 

this is the irule

 

when ACCESS_POLICY_AGENT_EVENT { if { [ACCESS::policy agent_id] eq "irule_http_header" }{

 

set userIdentity [ACCESS::session data get "session.logon.last.username"] HTTP::header insert "case" $userIdentity log local0. " case mumber is $userIdentity " pool Pool_test } }

 

Thanks,

 

Aviv Hassidim

 

1 Reply

  • Do you need to put the header in there on every request just certain ones?

    The

    ACCESS_POLICY_AGENT_EVENT
    event is used during login to APM when you have put an iRule event object in the flow through the VPE. If you're trying to put the header in every time a request is made, you'd do something like this

     This would be for all requests
    when HTTP_REQUEST {
         This will check to make sure the user has successfully logged in
        if {[ACCESS::policy equals "allow"]} { 
            HTTP::header insert "case" [ACCESS::session data get "session.logon.last.username"]
            log local0. "case mumber is [ACCESS::session data get "session.logon.last.username"]" 
            pool Pool_test 
        }
    }