Handle the case where @url is a URI object.

Fixes #1863