Forum Discussion

Thomas_Greco_11's avatar
Thomas_Greco_11
Icon for Nimbostratus rankNimbostratus
Jun 23, 2006

Mask URI

I'm trying to mask the entire URI in the browser when a request returns (Crystal Reports displays the db user and password in it). I originally tried using the HTTP_RESPONSE_DATA event, but it does not seem to access the HTTP::payload variable correctly because the IRule does nothing when that event is used. When the Irule below is enabled I get a Page Cannot Be Displayed message.

 

 

when HTTP_RESPONSE {

 

Find URI string

 

set str_indices [regexp -all -indices {\?apsuser} [HTTP::payload]]

 

foreach str_idx $str_indices {

 

set str_start [lindex $str_idx 0]

 

set str_end [lindex $str_idx 1]

 

set str_len [expr {$str_end - $str_start + 1}]

 

HTTP::payload replace $str_start $str_end [string repeat "X" $str_len]

 

}

 

}
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    The approach you've taken above would require that you issue an HTTP::collect command in HTTP_RESPONSE to begin collecting the payload, then use HTTP::payload command in HTTP_RESPONSE_DATA to evaluate what has been collected. (search for HTTP::collect in this forum for examples.)

     

     

    However, regex operations are resource-intensive, and we recommend using alternatives whenever available.

     

     

    To modify the links that the server is returning, you can take a much simpler approach by leveraging the built-in stream profile as detailed in this post: Click here

     

     

    HTH

     

    /deb