# Mask URI

**URL:** <https://community.f5.com/t/mask-uri/12874>\
**Category:** Technical Forums\
**Tags:** dev, irules, devops, application-delivery\
**Created:** [June 23, 2006, 4:18pm UTC](https://community.f5.com/t/mask-uri/12874 "2006-06-23T16:18:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thomas\_Greco\_11](https://avatars.discourse-cdn.com/v4/letter/t/b3f665/32.png) [@Thomas\_Greco\_11](https://community.f5.com/u/Thomas_Greco_11)\
**Post date:** [June 23, 2006, 4:18pm UTC](https://community.f5.com/t/mask-uri/12874/1 "2006-06-23T16:18:38Z")

</div>

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]

}

}

---

<div class="post-metadata">

**Author:** ![Deb\_Allen\_18](https://avatars.discourse-cdn.com/v4/letter/d/34f0e0/32.png) [@Deb\_Allen\_18](https://community.f5.com/u/Deb_Allen_18)\
**Post date:** [June 27, 2006, 8:02pm UTC](https://community.f5.com/t/mask-uri/12874/2 "2006-06-27T20:02:19Z")

</div>

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](http://devcentral.f5.com/Default.aspx?tabid=28&forumid=5&postid=8627&view=topic)

HTH

/deb
