Forum Discussion

rezgui_180607's avatar
rezgui_180607
Icon for Nimbostratus rankNimbostratus
Dec 24, 2014

about not contain

is that correct?

 

if { $http_path contains ".jsp" && not($http_path contains "sample.jsp") } {Drop}

 

thanks in advance

 

2 Replies

  • is that correct?

     

    if-condition looks okay to me but d in drop should be in small letter.

     

    anyway, to make it easier to read, you may code something like this.

     

    e.g.

     

    when HTTP_REQUEST {
      set http_path [string tolower [HTTP::path]]
    
      if { $http_path contains ".jsp" } {
        if { not ($http_path contains "sample.jsp") } {
          drop
        } else {
           Do something
        }
    
      } else {
         Do something
      }
    }