Forum Discussion
x-frame-options
I have had to do multiple irules to set different x-frame-options. So I have multiple irules setting x-frame-options, I want to write 1 irule that will pick the appropriate x-frame-option based on the host name that is returned. I have been working on the irule below but it doesnt seem to insert the header and causes my site not to be accessible when applied to the VS. The sites are SSL so can I not check the HTTP::host should I be grabbing the host another way?
when HTTP_REQUEST { set host [string tolower [HTTP::host]]
}
when HTTP_RESPONSE { if {[$host eq ";]} { HTTP::header insert X-Frame-Options "ALLOW-FROM ;
} else { HTTP::header replace X-Frame-Options "DENY" }
}
1 Reply
- pedinopa_170325
Nimbostratus
I found the solution with Data Groups.
when HTTP_REQUEST { set host [string tolower [HTTP::host] } when HTTP_RESPONSE { if {[class match $host contains URLdatagroup]} { HTTP::header replace X-Frame-Options "ALLOW-FROM ; } else { HTTP::header replace X-Frame-Options "ALLOW-FROM ; }
}
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com