Forum Discussion
Magnum_IP
Sep 29, 2011Nimbostratus
HTTP::uri returns full URL
I have had reason to log HTTP::uri while troubleshooting an error on a new Virtual Server. When I log HTTP::uri I see the full URL including protocol, for example,
http://www.domain.com/dir...
hooleylist
Sep 30, 2011Cirrostratus
There's an RFE for this, BZ222409. You could open a case with F5 Support and ask them to attach it to the RFE.
For now, you can add logic to your iRule to handle relative and absolute URIs:
http://devcentral.f5.com/Community/GroupDetails/tabid/1082223/asg/50/aft/1178966/showtab/groupforums/Default.aspx1249734
when HTTP_REQUEST {
Check for an absolute URI
if {not ([HTTP::uri] starts_with "/")}{
if {[scan $abs_uri {%[^/]//%[^/]%s} proto host uri] == 3}{
Log the URI to a local URI
log local0. "\$proto: $proto, \$host: $host, \$uri: $uri"
}
}
}
Aaron
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects