5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/ixtlan/core/extra_headers.rb', line 5
def self.included(base)
base.class_eval do
alias :render_old :render
def render(*args, &block)
(*args)
render_old(*args, &block)
end
alias :send_file_old :send_file
def send_file(*args)
(*args)
send_file_old(*args)
end
alias :send_data_old :send_data
def send_data(*args)
(*args)
send_file_old(*args)
end
private
def (*args)
opt = (args[0].is_a?(Hash) ? args[0] : args[1]) || {}
(opt[:cache_headers])
(opt[:x_frame_headers])
(opt[:x_content_type_headers])
(opt[:x_xss_protection_headers])
end
end
end
|