Forum Discussion
Please help: "Pool" in iRule breaks AJAX scripts?
Hi,
We use following simple irules for pool selection:
------------ cut here ---------
when HTTP_REQUEST {
if { [HTTP::uri] starts_with "/psreports/" } {
log local0. "Debug: using thrsit_psreports"
pool hrsit_b_pool
}
}
------------ cut here ---------It works for some years until recently the software upgraded and AJAX scripts are used. It returns error when following sequence occurs
- user access through default pool.
- user click on links with pattern "/psreports/". Request served by pool hrsit_b_pool without problem.
- user click on links without pattern "/psreports/". Suppose default pool is used. Then got error like following:
Function 'xxx' Error: Unable to get property 'indexOf' of undefined or null reference. The error occurs somewhere near the code below:
try
{
var loader=this; this.req.onreadystatechange=function()
{
loader.onReadyState.call(loader); }Then after 1 to 2 minutes, the link in step 3 above can be clicked without problem. I'm newbie to AJAX or Javascript, but just wonder if serving same browser session with different pools will break methods for "this" object, or did I go to the wrong direction?
Would anyone please help?
Thanks a lot. /ST Wong
1 Reply
- Seth_Cooper
Employee
Hi ST Wong,
Your best bet is to have your developers debug the site and see if the requests are getting the correct responses. If not then you have an issue with your iRule sending you to the wrong pool.
You might also try to add an "else" to your if statement and see if that helps.
------------ cut here --------- when HTTP_REQUEST { if { [HTTP::uri] starts_with "/psreports/" } { log local0. "Debug: using thrsit_psreports" pool hrsit_b_pool } else { pool default_pool_name } } ------------ cut here ---------Hope this helps!
Seth
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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