summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2023-01-08 09:58:58 +0100
committerDaniel Friesel <derf@finalrewind.org>2023-01-08 09:58:58 +0100
commit6c9662621486a506c4351fc49deba1b5989cca1d (patch)
tree7afabaf70f1001a2e957247ae5622fa0cb896cf3 /lib
parent95d8474a3042032967489f364bcc0dc461f6ed7a (diff)
webfinger: obtain base urls
Diffstat (limited to 'lib')
-rw-r--r--lib/Travelynx/Controller/Account.pm10
1 files changed, 5 insertions, 5 deletions
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{ ^ (?<name> [^@]+ ) [@] $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(