From 15ddabf95a34d834295484d7e4ee21515e6fc9da Mon Sep 17 00:00:00 2001 From: ThibG Date: Wed, 17 Jul 2019 00:00:39 +0200 Subject: Fix caching headers in ActivityPub endpoints (#11331) * Fix reverse-proxy caching in public fetch mode * Fix caching in ActivityPub-specific controllers --- app/controllers/activitypub/base_controller.rb | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 app/controllers/activitypub/base_controller.rb (limited to 'app/controllers/activitypub/base_controller.rb') diff --git a/app/controllers/activitypub/base_controller.rb b/app/controllers/activitypub/base_controller.rb new file mode 100644 index 000000000..a3b5c4dfa --- /dev/null +++ b/app/controllers/activitypub/base_controller.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class ActivityPub::BaseController < Api::BaseController + private + + def set_cache_headers + response.headers['Vary'] = 'Signature' if authorized_fetch_mode? + end +end -- cgit