Dan_L1
Apr 19, 2016Nimbostratus
iRule - HTTP REQUEST/RESPONSE - whitelist specific URI's
Hello,
I have an iRule I'm trying to implement for security headers, there are a handful of URI's that I need to whitelist, so far this is what I have:
when HTTP_REQUEST {
set uri [HTTP::uri]
}
when HTTP_RESPONSE {
if { not ( [class match [$uri] contains dgl_securityheaders] ) } {
HTTP::header insert X-XSS-Protection "1; mode=block"
HTTP::header insert X-Frame-Options "sameorigin"
HTTP::header insert X-Content-Type-Options "nosniff"
}
}
The issue I run into when putting this in place is the site will just give a connection reset, I'm guessing it's something to do with grabbing the URI variable, any ideas? Also, if I comment out the if statement, it works w/o issue, inside the dgl are just 2 URI's.
Thanks!