get rid of trailing \0 in uri

The uri parameter was getting sent with a trailing \0 in the path, which some servers don't particularly appreciate. This trims that so the path gets sent more properly.