Forum Discussion

Deb_Allen_18's avatar
Deb_Allen_18
Historic F5 Account
Jul 26, 2006

findclass match on empty string

We have this code:
findclass [findstr [HTTP::uri] "FeReqHdlg=" 10 "&"] $::FEserverClass
When the findstr command doesn't find a match (parameter is not present in URI), an empty string is returned (as expected).

 

 

When the findclass command runs, looking up the empty string in the indicated class, it always returns the first member of the class, rather than also returning an empty string.

 

 

I was hoping to verify whether this is expected behaviour before we open a Support case.

 

 

TIA

 

/deb

 

 

 

5 Replies

  • Colin_Walker_12's avatar
    Colin_Walker_12
    Historic F5 Account
    It sounds like this is not behaving as expected. If you search a class for a null string, it shouldn't spit back the first entry.

     

     

    Colin
  • Mind posting the version you are seeing this behavior on deb? Is it all versions?
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    9.2.3 is the version my customer is using, and I have no insight into what other versions may be affected.

    I have opened a case, waiting for a CR , will post it when I get it so you can watch the release notes for the fix.

    In the meantime, you just need to validate any variable value you want to push into findclass. My customer coded around the issue by checking for null string and replacing with "-":
    set FEHandler [findstr [HTTP::uri] "FeReqHdlg=" 10 "&"]
    if { [string length $FEHandler] == 0} {
       set FEHandler "-"
    }
    ...[findclass $FEHandler $::FEserverClass]...

    /deb
  • Deb_Allen_18's avatar
    Deb_Allen_18
    Historic F5 Account
    Good point. Can't remember why they took that approach, but it seemed to make sense at the time...

     

     

    CR68074 (for Sonoma) and CR68076 (targetted for 9.3.0) have created to track this issue.

     

     

    /deb