Forum Discussion
IRULE help for HTTP Referer value
Hello All,
I'm working on a iRule to get the HTTP referer value and to send a response to the client if the referer value is changed. iRule is working however if we use the http referer value as "http://x.abc.comm" then iRule is not responding back with 400 error message.
As per my expectation if the HTTP referer value is .abc.comm" then also load balancer should respond with 400 error message.
-------------------------------------------------
when HTTP_REQUEST {
set referer_host [URI::host [HTTP::header value Referer]]
if { [HTTP::header exists "Referer"] }
{
if {$referer_host contains ".abc.com"}{
log "Request allowed with Referer: [HTTP::header value Referer]"
}
else {
HTTP::respond 400 content "Bad Request" Content-Type "text/html"
}
}
}
--------------------------------------------------
Regards,
Thiyagu
Recent Discussions
* 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