Forum Discussion
dgytech
Altostratus
Dec 15, 2017iRule to exclude specific URI from http header insert (x-frame-options) on http_response
Attempting to exclude two URI from a http header insert on a HTTP_RESPONSE. Basically if the URI contains "/wp-login.php" or "/wp-admin" i do not want this header applied on the response.
I was pre...
Dec 17, 2017
You were almost there!
Unverified and not tested for syntax errors, but this should work. 🙂
when HTTP_REQUEST {
set uri [string tolower [HTTP::uri]]
if { $uri starts_with "/wp-login.php" or $uri starts_with "/wp-admin" } {
set xins 0
} else {
set xins 1
}
}
when HTTP_RESPONSE {
Also verify that the xins variable exists
if { [info exists xins] && $xins } {
HTTP::header insert "X-FRAME-OPTIONS" "SAMEORIGIN"
}
}
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects