This method should be private, as should `uri_encode_path`