debian-mirror-gitlab/app/controllers/concerns/floc_opt_out.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
344 B
Ruby
Raw Normal View History

2021-06-08 01:23:25 +05:30
# frozen_string_literal: true
module FlocOptOut
extend ActiveSupport::Concern
included do
2022-05-07 20:08:51 +05:30
before_action :set_floc_opt_out_header, unless: :floc_enabled?
2021-06-08 01:23:25 +05:30
end
def floc_enabled?
Gitlab::CurrentSettings.floc_enabled
end
def set_floc_opt_out_header
response.headers['Permissions-Policy'] = 'interest-cohort=()'
end
end