discourse/lib/read_only_header.rb

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

14 lines
240 B
Ruby
Raw Normal View History

2019-05-03 05:21:07 -05:00
# frozen_string_literal: true
module ReadOnlyHeader
2019-05-03 05:21:07 -05:00
def check_readonly_mode
@readonly_mode = Discourse.readonly_mode?
end
def add_readonly_header
response.headers['Discourse-Readonly'] = 'true' if @readonly_mode
end
end