I’m trying to the X-Frame-Options header replace for a website, however some of the pages on the site require that setting to NOT be set. So I’m trying to create a black list of pages and this is what I’ve come up with:
when HTTP_REQUEST {
set my_host_uri [HTTP::uri]
}
when HTTP_RESPONSE {
if {
(not ([string tolower $my_host_uri] contains "notThisSubfolder1")) &&
(not ([string tolower $my_host_uri] contains "notThisSubfolder2")) &&
(not ([string tolower $my_host_uri] contains "notThisSubfolder3"))
}
{
HTTP::header replace X-Frame-Options "SAMEORIGIN"
}
}
Should this work? Is there a better way to do this?