Forum Discussion
Hamish
Cirrocumulus
Oct 15, 2009b64decode errors...
I'm doing some testing on an iRule that uses b64decode to decode the cookie contents. The documentation (Wiki) says that b64decode returns the decoded string, OR "" if an error occurs.
...
hoolio
Cirrostratus
Oct 15, 2009I think it's been this way for a while. I have rules going back about two years where I was using catch to handle b64decode errors. The general method I've tried is to use catch and check that the result is not null length:
Try to base64 decode $string_b64encoded. Handle errors using catch.
Successful execution of b64decode by catch will return 0 and the output will be written to $string_b64decoded
if {[catch {b64decode $string_b64encoded} string_b64decoded] == 0 and $string_b64decoded ne ""}{
base64 decoding succeeded
} else {
base64 decoding failed
}
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
