fixes #7812 - pass URI string in to fix empty? error on Ruby 1.8/1.9

(cherry picked from commit a73bb350087bd63a04f7f86e2e268fd6f496ac4e)