Forum Discussion

natethegreat_23's avatar
natethegreat_23
Icon for Nimbostratus rankNimbostratus
Apr 28, 2017

iRule for ignoring request if it includes a specific parameter value

We currently have an iRule that is examining cookies to block or allow the request. We would also like to add a section that looks for a parameter's value. The parameter needs to equal "true" for it to pass. Below is a sample url and what we currently have as the iRule but it doesn't seem to be working:

https://www.site.com/path/location?xyz=abc&value=true&zzz=aaa

if { [HTTP::uri] starts_with "/path/" } 
{

    if { ![HTTP::query] contains "value=true" }
    {
                blocking action
            }
            else
            {   
                ignoring action
            }
      }
  }

Is there something we are missing or need to change for this to work? Thank you!