Good Morning all I have been searching in the docs and tried many things for a considerable amount ot time, but I do need help now. we have the following url: http://api.mycompany.com/web/impex/usageProfileExportAPI?contentProviderId=1234&usageProfileId=1234&fileFormat=JSON&ss.exp=20221022151011&ss.sig=9zz1b2e8f75004 I am trying to setup a rule that if usageProfileExportAPI and usageProfileId is present in the url then send the traffic to a pool if it is not present then send it to a black hole I have tried: $AllowExportAPI = http.getPath();
if( string.contains( $AllowExportAPI, "usageProfileExportAPI" ) ) {
if( string.contains( $AllowExportAPI, "usageProfileId" ) ) {
pool.use( "STG api.stg 10090" );
} else {
http.redirect( "https://www.mycompany.com" );
}
} else {
pool.use( "STG api.stg 10090" );
} and $AllowExportAPI = http.getPath();
if( string.contains( $AllowExportAPI, "usageProfileExportAPI" ) ) {
$AllowUsageProfile = http.getPath();
if( string.contains( $AllowUsageProfile, "usageProfileId" ) ) {
pool.use( "STG api.stg 10090" );
} else {
http.redirect( "https://www.mycompany.com" );
}
} else {
pool.use( "STG api.stg 10090" );
} and $AllowExportAPI = http.getPath();
if( string.contains( $AllowExportAPI, "usageProfileExportAPI" ) ) {
$AllowUsageProfile = http.getPath();
if( string.contains( $AllowUsageProfile, "usageProfileId" ) ) {
http.redirect( "https://www.mycompany.com" );
} else {
pool.use( "STG api.stg 10090" );
}
} else {
pool.use( "STG api.stg 10090" );
} and $AllowExportAPI = http.getPath();
if( string.contains( $AllowExportAPI, "usageProfileExportAPI" ) && string.contains( $AllowExportAPI, "usageProfileId" ) ) {
http.redirect( "https://www.mycompany.com/" );
} else {
pool.use( "STG api.stg 10090" );
} and $AllowExportAPI = http.getPath();
if( string.contains( $AllowExportAPI, "usageProfileExportAPI" ) & string.contains( $AllowExportAPI, "usageProfileId" ) ) {
http.redirect( "https://www.mycompany.com/" );
} else {
pool.use( "STG api.stg 10090" );
} and lastly: $AllowExportAPI = http.getPath();
if( string.contains( $AllowExportAPI, "usageProfileExportAPI" ))
{
http.redirect( "https://www.mycompany.com/" );
} else {
pool.use( "STG api.stg 10090" );
}
if (!string.contains( $AllowExportAPI, "usageProfileId" ))
{
http.redirect( "https://www.mycompany.com/" );
} None of these worked so for now I am using: $AllowExportAPI = http.getPath();
if( string.contains( $AllowExportAPI, "usageProfileExportAPI" ) ) {
http.redirect( "https://www.mycompany.com/" );
} until I can get this sorted. Can anybody please help with this? Thank you Kobus
... View more