From 7b060dff68841543e08e516a1dbdcdceea8fb59a Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 20 Sep 2017 19:12:23 -0700 Subject: add HTTP link header to channel page, making it pluggable --- Zotlabs/Web/Router.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Zotlabs/Web') diff --git a/Zotlabs/Web/Router.php b/Zotlabs/Web/Router.php index 710aa2844..b0193652b 100644 --- a/Zotlabs/Web/Router.php +++ b/Zotlabs/Web/Router.php @@ -178,6 +178,25 @@ class Router { */ if(\App::$module_loaded) { + if (( \App::$module === 'channel' ) && argc() > 1) { + \App::$channel_links = [ + [ + 'rel' => 'lrdd', + 'type' => 'application/xrd+xml', + 'url' => z_root() . '/xrd?f=&uri=acct%3A' . argv(1) . '%40' . \App::get_hostname() + ], + [ + 'rel' => 'jrd', + 'type' => 'application/jrd+json', + 'url' => z_root() . '/.well-known/webfinger?f=&resource=acct%3A' . argv(1) . '%40' . \App::get_hostname() + ], + ]; + $x = [ 'channel_address' => argv(1), 'channel_links' => \App::$channel_links ]; + call_hooks('channel_links', $x ); + \App::$channel_links = $x['channel_links']; + header('Link: ' . \App::get_channel_links()); + } + \App::$page['page_title'] = \App::$module; $placeholder = ''; -- cgit v1.2.3