Permalink
Browse files

Captcha images are small, try send_data instead of send_file + X-Acce…

…l-Redirect
  • Loading branch information...
1 parent 341c043 commit a2789153422c672faf15841abb20283d423135c2 Nick Hengeveld committed Oct 22, 2010
Showing with 3 additions and 4 deletions.
  1. +3 −4 app/controllers/simple_captcha_controller.rb
@@ -5,10 +5,9 @@ class SimpleCaptchaController < ActionController::Metal
# GET /simple_captcha
def show
unless params[:id].blank?
- image_file = generate_simple_captcha_image(params[:id])
- response.headers['X-Accel-Redirect'] = image_file
- send_file(
- image_file,
+ image = File.read generate_simple_captcha_image(params[:id])
+ send_data(
+ image,
:type => 'image/jpeg',
:disposition => 'inline',
:filename => 'simple_captcha.jpg')

0 comments on commit a278915

Please sign in to comment.