Forum Discussion

jquinones82_469's avatar
Icon for Nimbostratus rankNimbostratus
Oct 20, 2010

how do you check for a null http referer

I want to check for a blank http referer for an IRULE



([HTTP::header "Referer"] equals $null)



is there some type of variable or way to check for this?



Would I have to use the length function for the http::referrer?




3 Replies

  • I think [HTTP::header $header_name] will return a null string even if the header doesn't exist, so you could combine that with a check to see if the header exists:



    if {[HTTP::header exists Referer] && [HTTP::header Referer] eq ""}{



    Or if you just want to check that it's not null you could use:



    if {[HTTP::header Referer] ne ""}{