From 6c9662621486a506c4351fc49deba1b5989cca1d Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 8 Jan 2023 09:58:58 +0100 Subject: webfinger: obtain base urls --- lib/Travelynx/Controller/Account.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/Travelynx/Controller/Account.pm b/lib/Travelynx/Controller/Account.pm index 334ec97..d8b104e 100644 --- a/lib/Travelynx/Controller/Account.pm +++ b/lib/Travelynx/Controller/Account.pm @@ -974,16 +974,16 @@ sub webfinger { my $resource = $self->param('resource'); if ( not $resource ) { - $self->render('not_found'); + $self->render( 'not_found', status => 404 ); return; } - my $root_url = $self->url_for('/')->host; + my $root_url = $self->base_url_for('/')->to_abs->host; if ( not $root_url or not $resource =~ m{ ^ (? [^@]+ ) [@] $root_url $ }x ) { - $self->render('not_found'); + $self->render( 'not_found', status => 404 ); return; } @@ -991,11 +991,11 @@ sub webfinger { my $user = $self->users->get_privacy_by_name( name => $name ); if ( not $user or not $user->{public_level} & 0x22 ) { - $self->render('not_found'); + $self->render( 'not_found', status => 404 ); } my $profile_url - = $self->url_for("/p/${name}")->to_abs->scheme('https')->to_string; + = $self->base_url_for("/p/${name}")->to_abs->scheme('https')->to_string; $self->render( text => JSON->new->encode( -- cgit v1.2.3