Forum Discussion
Tobias_Neumeyer
Nimbostratus
Jun 29, 2009iRule / uri parameter manipulation
Hi,
Sorry, but I need some help from some experts again.
I'm trying to write an iRule which modifies a post request to the server.
This is the example request.
...
hoolio
Cirrostratus
Jun 29, 2009Hi Tobias,
Something like this?
when HTTP_REQUEST {
Check if path ends with /searchresults.aspx
if {[string tolower [HTTP::path]] ends_with "/searchresults.aspx"}{
Rewrite URI for u=http:// to u=https://
HTTP::uri [string map -nocase {u=http:// to u=https://} [HTTP::uri]
log local0. "[IP::client_addr]:[TCP::client_port]: Updated query string to [HTTP::query]"
}
}
I'm assuming there won't be any other scenarios where a parameter ends with u and starts with http://. I suppose you could parse the actual value for an actual parameter named "u" using [URI::query [HTTP::uri] u], replace http:// with https:// and then replace the original value with the updated one. But that seems like a log of unnecessary overhead.
Aaron
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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