Forum Discussion
Blaisure_212538
Nimbostratus
Jan 05, 2016ASM Referrer Support - iRule
We have ran into a problem when we enable the web scraping policy in ASM it injects a JavaScript client-side challenge that inadvertently changes the referrer header to reflect the landing page rathe...
Kai_Wilke
MVP
Jan 05, 2016Hi Blaisure,
you can try the iRules below...
when HTTP_REQUEST {
set referer [HTTP::header "Referer"]
}
when HTTP_REQUEST_SEND {
if { $referer starts_with "http" } then {
clientside{
HTTP::header replace "Referer" $referer
}
}
}
There is no need to test the existence of the
[HTTP::header] during HTTP_REQUEST before accessing it. You will either get a "" (nothing) or a certain "referer_value" back. In HTTP_REQUEST_SEND you would then still check for valid referer information before writing it back to the request.
Good luck with your iRules solution!
BTW: Didn't test the functionality. But at least the formating should be now correct.
Cheers, Kai
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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