diff app/controllers/pastes_controller.rb @ 229:388504e43bcf

Properly return 404 when requesting invalid paste.
author Edho Arief <edho@myconan.net>
date Wed, 15 May 2013 14:10:35 +0900
parents fb9909885d63
children 16251b94eb6c
line wrap: on
line diff
--- a/app/controllers/pastes_controller.rb	Mon May 13 13:20:53 2013 +0900
+++ b/app/controllers/pastes_controller.rb	Wed May 15 14:10:35 2013 +0900
@@ -5,6 +5,7 @@
   # GET /1.txt
   def show
     @paste = Paste.safe_find(params[:id])
+    head :not_found and return unless @paste
 
     expires_in 1.year, :public => true
     respond_to do |format|