]> Sergey Matveev's repositories - public-inbox.git/commitdiff
unsubscribe: bad URL fixup
authorEric Wong <e@80x24.org>
Sat, 21 May 2016 04:12:45 +0000 (04:12 +0000)
committerEric Wong <e@80x24.org>
Sat, 21 May 2016 04:12:45 +0000 (04:12 +0000)
Fixup a comment about s/query string/PATH_INFO/ while
we're at it, as pre-published versions of this used
query strings before I determined it could be harder
to copy+paste URLs with query parameters in them.

lib/PublicInbox/Unsubscribe.pm

index 1f5ce315a81651e6fa83a68c7b7d4b8de985ad5c..4ccdb7e0e33b38f8308650a4119a68cbc82bfe8a 100644 (file)
@@ -77,7 +77,7 @@ sub _user_list_addr {
                        'Missing mailing list name in path component');
        }
        my $user = eval { $self->{cipher}->decrypt(decode_base64url($u)) };
-       if (!defined $user) {
+       if (!defined $user || $user eq '') {
                my $err = quotemeta($@);
                my $errors = $env->{'psgi.errors'};
                $errors->print("error decrypting: $u\n");
@@ -86,7 +86,7 @@ sub _user_list_addr {
        }
 
        # The URLs are too damn long if we have the encrypted domain
-       # name in the query string
+       # name in the PATH_INFO
        if (index($list, '@') < 0) {
                my $host = (split(':', $env->{HTTP_HOST}))[0];
                $list .= '@'.$host;