class EasyCaptcha::CaptchaController

captcha controller

Public Instance Methods

captcha() click to toggle source

captcha action send the generated image to browser

# File lib/easy_captcha/captcha_controller.rb, line 6
def captcha
  if params[:format] == "wav" and EasyCaptcha.espeak?
    send_data generate_speech_captcha, :disposition => 'inline', :type => 'audio/wav'
  else
    send_data generate_captcha, :disposition => 'inline', :type => 'image/png'
  end
end

Private Instance Methods

overwrite_cache_control() click to toggle source

Overwrite cache control for Samsung Galaxy S3 (remove no-store)

# File lib/easy_captcha/captcha_controller.rb, line 16
def overwrite_cache_control
  response.headers["Cache-Control"] = "no-cache, max-age=0, must-revalidate"
  response.headers["Pragma"] = "no-cache"
  response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end