Forum Discussion
PeteW
Nimbostratus
Jun 13, 2012Custom expect script to Oracle app server
Afternoon chaps,
I have an Oracle application that listens on 10 specific ports to allow remote devices to access an Oracle app cluster.
The application running on the app servers is ...
Michael_Yates
Nimbostratus
Sep 19, 2011Hi Daniel,
I created an example for you. In my example I capture the "-value" of a matching "-name" and store it in a variable. In the if statement, if a match was found and the value is not empty then it will redirect to the location.
I am providing the Data Group and the iRule so that you can make modifications and test with hit.
class string_value_test_group {
{
"/foo" { "http://www.yahoo.com" }
"/foofoo" { "http://www.google.com" }
"/foofoofoo" { "http://www.msn.com" }
}
}
when HTTP_REQUEST {
set redirecturl [class match -value [string tolower [HTTP::uri]] starts_with string_value_test_group ]
if { $redirecturl ne "" } {
HTTP::respond 301 Location $redirecturl
}
}
Hope this helps.
- Hi Ken,
if {[HTTP::header "Content-Length"] contains "text" && \ [HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576}{
- The_BhattmanJan 07, 2010
Nimbostratus
Hi Ken, - Madiw_114772May 04, 2014
Nimbostratus
Just for people that would need that in the future, I used HTTP_RESPONSE_DATA instead of HTTP_REQUEST_DATA For the testing on the content, I used if {[HTTP::header "Content-Type"] contains "text" && [HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576}{