Add Deprecation headers on deprecated endpoints (#34262)

Co-authored-by: Damien Mathieu <42@dmathieu.com>
This commit is contained in:
Claire 2025-03-25 13:30:10 +01:00 committed by GitHub
parent 40bb8ec325
commit 38f5e74122
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 121 additions and 12 deletions

View file

@ -1,15 +1,9 @@
# frozen_string_literal: true
class Api::V1::InstancesController < Api::BaseController
skip_before_action :require_authenticated_user!, unless: :limited_federation_mode?
skip_around_action :set_locale
class Api::V1::InstancesController < Api::V2::InstancesController
include DeprecationConcern
vary_by ''
# Override `current_user` to avoid reading session cookies unless in limited federation mode
def current_user
super if limited_federation_mode?
end
deprecate_api '2022-11-14'
def show
cache_even_if_authenticated!