rucaptcha/app/controllers/ru_captcha/captcha_controller.rb

13 lines
375 B
Ruby

module RuCaptcha
class CaptchaController < ActionController::Base
def index
return head :ok if request.head?
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' }
send_data data, opts
end
end
end