Forum Discussion
earton_25699
Nimbostratus
Mar 21, 2009iRule for IE8
With the release of IE8 yesterday, I need to be able to automatically make users who have IE8 installed to be forced into an IE7 compatible mode. I have read some articles on Microsoft that details do...
hoolio
Cirrostratus
Mar 25, 2009A global variable will be accessible and changeable across all TCP connections. You'd want to use a local variable so that it's only accessible across a single TCP connection.
With that said, I don't think there is any reason to check whether to insert the response header or not. Just insert it in every response and non-IE8 browsers will ignore it.
If you do want to check the User-Agent header before setting the custom X-UA-Compatible header in the response, you could do something like this. Note, as Joe always says, you should use string operations instead of regexes whenever possible to save CPU cycles/memory.
when HTTP_REQUEST {
Check if User-Agent header is IE 8
if { [HTTP::header User-Agent] contains "MSIE 8" } {
set IE8Resp 1
} else {
set IE8Resp 0
}
}
when HTTP_RESPONSE {
if { $IE8Resp } {
log "[IP::client_addr]:[TCP::client_port] inserting header"
HTTP::header insert "X-UA-Compatible" "IE=EmulateIE7"
}
}
Aaron
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