webfinger: adjust profile visibility

This commit is contained in:
Daniel Friesel 2023-03-04 13:23:19 +01:00
parent 5461326f01
commit c0fb7c1b13
No known key found for this signature in database
GPG key ID: 100D5BFB5166E005

View file

@ -986,7 +986,8 @@ sub webfinger {
my $root_url = $self->base_url_for('/')->to_abs->host; my $root_url = $self->base_url_for('/')->to_abs->host;
if ( not $root_url if ( not $root_url
or not $resource =~ m{ ^ acct: (?<name> [^@]+ ) [@] $root_url $ }x ) or not $resource
=~ m{ ^ acct: [@]? (?<name> [^@]+ ) [@] $root_url $ }x )
{ {
$self->render( 'not_found', status => 404 ); $self->render( 'not_found', status => 404 );
return; return;
@ -995,7 +996,7 @@ sub webfinger {
my $name = $+{name}; my $name = $+{name};
my $user = $self->users->get_privacy_by_name( name => $name ); my $user = $self->users->get_privacy_by_name( name => $name );
if ( not $user or not $user->{public_level} & 0x22 ) { if ( not $user ) {
$self->render( 'not_found', status => 404 ); $self->render( 'not_found', status => 404 );
return; return;
} }