New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting Password Leaves Colon Behind #13

theory opened this Issue Dec 6, 2013 · 0 comments


None yet
1 participant

theory commented Dec 6, 2013

 % perl -MURI -E 'my $u = URI->new("rsync://foo:bar\"); $u->password(undef); say $u'

I think the output should actually be:


I think this patch would fix it:

--- a/URI/
+++ b/URI/
@@ -35,8 +35,8 @@ sub password
    my $user = defined($info) ? $info : "";
    $user =~ s/:.*//;

-   if (!defined($new) && !length($user)) {
-       $self->userinfo(undef);
+   if (!defined($new)) {
+       $self->userinfo(length $user ? $user : undef);
    } else {
        $new = "" unless defined($new);
        $new =~ s/%/%25/g;

joenio added a commit to joenio/uri that referenced this issue Jan 24, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment