Forum Discussion
Jeff_Brinkerho1
Nimbostratus
Apr 09, 2010Rquest: irule to detect if browser has javascript enabled
Our developers have requested that the ltm1500 we are using to load balance and SSL terminate our Peoplesoft environmnent also be able to determine if a client's browser has javascript enabled. If so, pass them on to the original requested pool, if not redirect them to a static HTML page that explains browser requirements.
I have searched, and have not found anyone who has done something like this. Can anyone help?
Thanks
Jeff
- hoolio
Cirrostratus
Hi Jeff,when HTTP_REQUEST { Check if this is a request to the custom URI if {[HTTP::path] eq "/js_disabled" { HTTP::respond 302 Location [HTTP::header Referer] Set-Cookie "js=disabled; path=\"/\";" } Check all URIs or just some? For example, just check html pages if {not ([HTTP::path] ends_with ".html")}{ This is a URI we don't want to check for Javascript support on Exit this event in this iRule return } If we're still in the iRule, we're going to check for Javascript support as indicated by a cookie switch [HTTP::cookie js] { "enabled" { pool js_pool } "disabled" { pool nonjs_pool } default { Need to test if the client supports Javascript by trying to set a cookie named js If the client doesn't have Javascript enabled, force them to make a request to a custom URI which sets a cookie indicating the client doesn't have JS enabled (for example: /js_disabled) HTTP::respond 200 {...} } } }
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