about summary refs log tree commit diff
path: root/app/controllers/stream_entries_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/stream_entries_controller.rb')
-rw-r--r--app/controllers/stream_entries_controller.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/controllers/stream_entries_controller.rb b/app/controllers/stream_entries_controller.rb
index c26149627..e25e7f5ed 100644
--- a/app/controllers/stream_entries_controller.rb
+++ b/app/controllers/stream_entries_controller.rb
@@ -3,6 +3,7 @@ class StreamEntriesController < ApplicationController
 
   before_action :set_account
   before_action :set_stream_entry
+  before_action :set_link_headers
 
   def show
     @type = @stream_entry.activity_type.downcase
@@ -33,6 +34,12 @@ class StreamEntriesController < ApplicationController
     @account = Account.find_local!(params[:account_username])
   end
 
+  def set_link_headers
+    response.headers['Link'] = LinkHeader.new([
+      [account_stream_entry_url(@account, @stream_entry, format: 'atom'), [['rel', 'alternate'], ['type', 'application/atom+xml']]]
+    ])
+  end
+
   def set_stream_entry
     @stream_entry = @account.stream_entries.find(params[:id])
   end