rucaptcha/app/controllers/ru_captcha/captcha_controller.rb

17 lines
416 B
Ruby
Raw Normal View History

2015-10-26 06:09:39 +00:00
module RuCaptcha
class CaptchaController < ActionController::Base
def index
headers['Cache-Control'] = 'no-cache, no-store, max-age=0, must-revalidate'
headers['Pragma'] = 'no-cache'
data = generate_rucaptcha
opts = { disposition: 'inline', type: 'image/gif' }
2015-10-26 06:09:39 +00:00
if Gem.win_platform?
send_file data, opts
else
send_data data, opts
end
2015-10-26 06:09:39 +00:00
end
end
end