summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
authorBirte Kristina Friesel <derf@finalrewind.org>2024-04-26 17:47:32 +0200
committerBirte Kristina Friesel <derf@finalrewind.org>2024-04-26 17:47:32 +0200
commit0a8597156565582bc9e844db4d497b6cbe793602 (patch)
tree8bae18f23dcecadbf9e53693c9e0b08f9193f5c1 /lib/Travelynx.pm
parent8d7e66cdc8150b5390f7cc1de90609a461cc6cc9 (diff)
/status: respond to .json as well as "Accept: application/json"
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm
index 4d04e9e..4749d65 100755
--- a/lib/Travelynx.pm
+++ b/lib/Travelynx.pm
@@ -2358,8 +2358,10 @@ sub startup {
$r->get('/recover')->to('account#request_password_reset');
$r->get('/recover/:id/:token')->to('account#recover_password');
$r->get('/reg/:id/:token')->to('account#verify');
- $r->get('/status/:name')->to('profile#user_status');
- $r->get('/status/:name/:ts')->to('profile#user_status');
+ $r->get( '/status/:name' => [ format => [ 'html', 'json' ] ] )
+ ->to( 'profile#user_status', format => undef );
+ $r->get( '/status/:name/:ts' => [ format => [ 'html', 'json' ] ] )
+ ->to( 'profile#user_status', format => undef );
$r->get('/ajax/status/#name')->to('profile#status_card');
$r->get('/ajax/status/:name/:ts')->to('profile#status_card');
$r->get('/p/:name')->to('profile#profile');