diff --git a/lib/feed.php b/lib/feed.php index e04c69be6c..d61c3e8a34 100644 --- a/lib/feed.php +++ b/lib/feed.php @@ -62,6 +62,11 @@ class Feed $this->title = $title; } + function getUrl() + { + return $this->url; + } + function mimeType() { switch ($this->type) { diff --git a/lib/noticestreamaction.php b/lib/noticestreamaction.php index fb592915a7..e668a27daf 100644 --- a/lib/noticestreamaction.php +++ b/lib/noticestreamaction.php @@ -34,6 +34,18 @@ abstract class NoticestreamAction extends ProfileAction // pass by default } + public function extraHeaders() + { + parent::extraHeaders(); + foreach ($this->getFeeds() as $feed) { + header('Link: <'.htmlspecialchars($feed->getUrl()).'>;' . + ' rel="'.htmlspecialchars($feed->rel()).'";' . + ' type="'.htmlspecialchars($feed->mimeType()).'"', + false // don't overwrite previous headers of this sort + ); + } + } + // this fetches the NoticeStream abstract public function getStream(); }