about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2018-02-02 10:54:04 +0100
committerEugen Rochko <eugen@zeonfederated.com>2018-02-02 10:54:04 +0100
commitac1093256c500f55a6578836c3364d4a8a67ee58 (patch)
tree6c4b0794eb56cbebaa3bbd0efc6e215fd124998e /app
parentaf4082499873f54047050655ee63a2fdc3b53b99 (diff)
Allow HTTP caching of atom-rendered public toots (OStatus compatibility) (#6207)
Diffstat (limited to 'app')
-rw-r--r--app/controllers/stream_entries_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/stream_entries_controller.rb b/app/controllers/stream_entries_controller.rb
index cc579dbc8..f81856cc6 100644
--- a/app/controllers/stream_entries_controller.rb
+++ b/app/controllers/stream_entries_controller.rb
@@ -10,6 +10,7 @@ class StreamEntriesController < ApplicationController
   before_action :set_stream_entry
   before_action :set_link_headers
   before_action :check_account_suspension
+  before_action :set_cache_headers
 
   def show
     respond_to do |format|
@@ -19,6 +20,10 @@ class StreamEntriesController < ApplicationController
       end
 
       format.atom do
+        unless @stream_entry.hidden?
+          skip_session!
+          expires_in 3.minutes, public: true
+        end
         render xml: OStatus::AtomSerializer.render(OStatus::AtomSerializer.new.entry(@stream_entry, true))
       end
     end