Forum Discussion
Kai_Wilke
Dec 14, 2016MVP
Hi Zuke,
you may try the iRule below to conditional inject the X-Frame-Option header...
when HTTP_REQUEST {
if { ( [string tolower [HTTP::host]] eq "domain.example.edu" )
and not ( [string tolower [HTTP::uri]] starts_with "/sites/prod" ) } then {
set insert_x_frame_options 1
log local0.debug "[HTTP::host][HTTP::uri] requires x_frame_options"
} else {
set insert_x_frame_options 0
log local0.debug "[HTTP::host][HTTP::uri] does not require x_frame_options"
}
}
when HTTP_RESPONSE {
if { $insert_x_frame_options } then {
HTTP::header insert "X-Frame-Options" "SAMEORIGIN"
log local0.debug "Injected x_frame_options"
}
}
Cheers, Kai