Forum Discussion

Raja_M's avatar
Raja_M
Icon for Nimbostratus rankNimbostratus
May 20, 2018

Irule is not working as expected for string based allow the user to the VIP

We have configured irule to allow users to connect the Pool members only contains with the below string to lower only if not it will through message like "Sorry, this page is restricted", for all the string its working expect one string "/solr/searchByLineNr/select" its not working.

 

URl: http://qaf.abc.com/solr/searchByLineNr/select =====> This alone not working and its going to Sorry, this page is restricted

 

working URL: http://qaf.abc.com/solr/searchByName/select =========> This is working one.

 

when HTTP_REQUEST { if { ([string tolower [HTTP::uri]] contains "/solr/variants/select" ) || ([string tolower [HTTP::uri]] contains "/solr/offers/select" ) || ([string tolower [HTTP::uri]] contains "/solr/products/select" ) || ([string tolower [HTTP::uri]] contains "/solr/searchByName/select") || ([string tolower [HTTP::uri]] contains "/solr/searchByLineNr/select") || ([string tolower [HTTP::uri]] contains "/solr/categories/select") }{ pool Pool_8983 } else { HTTP::respond 200 content { Sorry Page Sorry, this Page is restricted. } } }

 

1 Reply

  • You have included upper case characters in your comparison string after explicitly doing a

    [string tolower [HTTP::uri]]
    when HTTP_REQUEST { 
      if { ([string tolower [HTTP::uri]] contains "/solr/variants/select" ) || 
           ([string tolower [HTTP::uri]] contains "/solr/offers/select" ) || 
           ([string tolower [HTTP::uri]] contains "/solr/products/select" )  || 
           ([string tolower [HTTP::uri]] contains "/solr/searchbyname/select") || 
           ([string tolower [HTTP::uri]] contains "/solr/searchbylinenr/select") || 
           ([string tolower [HTTP::uri]] contains "/solr/categories/select") }
             { pool Pool_8983 } 
      else { HTTP::respond 200 content { Sorry, this Page is restricted. } 
      } 
    }
    

    That should fix your irule.