Skip to content

Commit

Permalink
Add X-Accel-Redirect header for nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Hengeveld authored and Nick Hengeveld committed Oct 22, 2010
1 parent 3c31f5d commit 341c043
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/controllers/simple_captcha_controller.rb
Expand Up @@ -5,8 +5,10 @@ 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(
generate_simple_captcha_image(params[:id]),
image_file,
:type => 'image/jpeg',
:disposition => 'inline',
:filename => 'simple_captcha.jpg')
Expand Down

0 comments on commit 341c043

Please sign in to comment.