From 183841d10e7acbb6dad17cc7cc3283817d44164b Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 9 Aug 2007 07:45:04 +0000 Subject: [PATCH] Return "404 Not Found" for users and traces which don't exist. --- app/controllers/trace_controller.rb | 2 ++ app/controllers/user_controller.rb | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/trace_controller.rb b/app/controllers/trace_controller.rb index de8b17f30..b758d0c40 100644 --- a/app/controllers/trace_controller.rb +++ b/app/controllers/trace_controller.rb @@ -88,6 +88,8 @@ class TraceController < ApplicationController render :nothing, :status => :forbidden if @trace.user.id != @user.id end end + rescue ActiveRecord::RecordNotFound + render :nothing => true, :status => :not_found end def create diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 0042be316..d945e53a2 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -172,7 +172,12 @@ class UserController < ApplicationController def view @this_user = User.find_by_display_name(params[:display_name]) - @title = @this_user.display_name + + if @this_user + @title = @this_user.display_name + else + render :nothing => true, :status => :not_found + end end def make_friend -- 2.43.2