diff options
author | Reverite <github@reverite.sh> | 2019-04-12 01:38:18 -0700 |
---|---|---|
committer | Reverite <github@reverite.sh> | 2019-04-12 01:38:18 -0700 |
commit | e10a9794f4ed7c90e3190f285359f55dd00da435 (patch) | |
tree | 579ebf95d6bbf091d05e66907a9c8168c926e0af /app/controllers/following_accounts_controller.rb | |
parent | ff736905fa534f7189e57c1d0c14fbac45f239a1 (diff) | |
parent | bb50ec2e6687238ad8b2ec545a73270fee7a7b09 (diff) |
Merge branch 'glitch' into production
Diffstat (limited to 'app/controllers/following_accounts_controller.rb')
-rw-r--r-- | app/controllers/following_accounts_controller.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/app/controllers/following_accounts_controller.rb b/app/controllers/following_accounts_controller.rb index 098b2a20c..181f85221 100644 --- a/app/controllers/following_accounts_controller.rb +++ b/app/controllers/following_accounts_controller.rb @@ -3,10 +3,13 @@ class FollowingAccountsController < ApplicationController include AccountControllerConcern + before_action :set_cache_headers + def index respond_to do |format| format.html do use_pack 'public' + mark_cacheable! unless user_signed_in? next if @account.user_hides_network? @@ -17,6 +20,11 @@ class FollowingAccountsController < ApplicationController format.json do raise Mastodon::NotPermittedError if params[:page].present? && @account.user_hides_network? + if params[:page].blank? + skip_session! + expires_in 3.minutes, public: true + end + render json: collection_presenter, serializer: ActivityPub::CollectionSerializer, adapter: ActivityPub::Adapter, |