Fix: ruby rt_client breaks when RT sub version number has two digits

Upgrading from RT 3.8.7 to 3.8.10 revealed a bug in the Ruby rt-client library.

In several places, the following regular expression is used in client.rb:

resp.gsub!(/RT/\d.\d.\d\s\d{3}\s.*\n\n/,"") # toss the HTTP response

but that does not catch 3.8.10. It could/should be:

resp.gsub!(/RT/\d.\d.\d+\s\d{3}\s.*\n\n/,"") # toss the HTTP response

I tested this simple fix and it works here.

Thanks,
Thierry Thelliez

Upgrading from RT 3.8.7 to 3.8.10 revealed a bug in the Ruby rt-client library.

In several places, the following regular expression is used in client.rb:

resp.gsub!(/RT/\d.\d.\d\s\d{3}\s.*\n\n/,"") # toss the HTTP response

but that does not catch 3.8.10. It could/should be:

resp.gsub!(/RT/\d.\d.\d+\s\d{3}\s.*\n\n/,"") # toss the HTTP response

It should be closer to \d+.\d+.\d+((a|alpha|b|beta|pre|rc)\d*)?

Cced Tom (author of the client). Cc authors all the time you start
thread about extensions.

I tested this simple fix and it works here.

Thanks,
Thierry Thelliez

Best regards, Ruslan.

Actually, since there is no version checking, there could be a simpler
check for just ’ * 200 Ok’.

Thierry

Yea, I’ve got some other stuff to merge in as well from some other users. You don’t have a patch for that, do you?

Tom Lahti, SCMDBA, LPIC-1, CLA
BIT LLC
425-251-0833 x 117On Aug 15, 2011, at 5:09 PM, Thierry Thelliez wrote:

Actually, since there is no version checking, there could be a simpler
check for just ’ * 200 Ok’.

Thierry