diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-07-30 11:10:46 +0200 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2020-02-21 01:02:20 -0600 |
commit | b4d97bc26baff0a9867f1e510a7630dd34b8049d (patch) | |
tree | 4637f1ead39e9e0748066445f94798b0d5f38fd4 /app/controllers/api/v1/instances | |
parent | 08f6b74097aacb2cf1c3894d4a58c0b2272a9fa5 (diff) |
port tootsuite#11292 to monsterfork: Add whitelist mode
Diffstat (limited to 'app/controllers/api/v1/instances')
-rw-r--r-- | app/controllers/api/v1/instances/activity_controller.rb | 3 | ||||
-rw-r--r-- | app/controllers/api/v1/instances/peers_controller.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/controllers/api/v1/instances/activity_controller.rb b/app/controllers/api/v1/instances/activity_controller.rb index cd15d1231..b30e8464c 100644 --- a/app/controllers/api/v1/instances/activity_controller.rb +++ b/app/controllers/api/v1/instances/activity_controller.rb @@ -2,6 +2,7 @@ class Api::V1::Instances::ActivityController < Api::BaseController before_action :require_enabled_api! + skip_before_action :set_cache_headers skip_before_action :require_authenticated_user!, unless: :whitelist_mode? @@ -34,6 +35,6 @@ class Api::V1::Instances::ActivityController < Api::BaseController end def require_enabled_api! - head 404 unless Setting.activity_api_enabled + head 404 unless Setting.activity_api_enabled && !whitelist_mode? end end diff --git a/app/controllers/api/v1/instances/peers_controller.rb b/app/controllers/api/v1/instances/peers_controller.rb index ae75f6647..3a4c11783 100644 --- a/app/controllers/api/v1/instances/peers_controller.rb +++ b/app/controllers/api/v1/instances/peers_controller.rb @@ -2,6 +2,7 @@ class Api::V1::Instances::PeersController < Api::BaseController before_action :require_enabled_api! + skip_before_action :set_cache_headers skip_before_action :require_authenticated_user!, unless: :whitelist_mode? @@ -20,6 +21,6 @@ class Api::V1::Instances::PeersController < Api::BaseController end def require_enabled_api! - head 404 unless Setting.peers_api_enabled + head 404 unless Setting.peers_api_enabled && !whitelist_mode? end end |