Fix shadowed variable

Previously, a variable was shadowed turning it from a string into a
URI.  URI in < 2.0 does not have an empty? method and therefore isn't
compatible with String in many places.  This change ensures that uri
is no longer shadowed and the original string is used in places that
it should be.

[#49350749]
Merge 49350749-empty to master

[Completes #49350749]