Skip to content
Snippets Groups Projects
Commit 15ddabf9 authored by ThibG's avatar ThibG Committed by Eugen Rochko
Browse files

Fix caching headers in ActivityPub endpoints (#11331)

* Fix reverse-proxy caching in public fetch mode

* Fix caching in ActivityPub-specific controllers
parent 91544a6c
No related branches found
No related tags found
No related merge requests found
# frozen_string_literal: true
class ActivityPub::BaseController < Api::BaseController
private
def set_cache_headers
response.headers['Vary'] = 'Signature' if authorized_fetch_mode?
end
end
# frozen_string_literal: true
class ActivityPub::CollectionsController < Api::BaseController
class ActivityPub::CollectionsController < ActivityPub::BaseController
include SignatureVerification
include AccountOwnedConcern
......
# frozen_string_literal: true
class ActivityPub::OutboxesController < Api::BaseController
class ActivityPub::OutboxesController < ActivityPub::BaseController
LIMIT = 20
include SignatureVerification
......
# frozen_string_literal: true
class ActivityPub::RepliesController < Api::BaseController
class ActivityPub::RepliesController < ActivityPub::BaseController
include SignatureAuthentication
include Authorization
include AccountOwnedConcern
......
......@@ -160,6 +160,6 @@ class ApplicationController < ActionController::Base
end
def set_cache_headers
response.headers['Vary'] = 'Accept, Signature'
response.headers['Vary'] = public_fetch_mode? ? 'Accept' : 'Accept, Signature'
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment