404 googlebotz left and right on public remote person pages

This commit is contained in:
maxwell 2011-03-22 11:26:39 -07:00
parent 35bc86f6a6
commit dc60181033
2 changed files with 13 additions and 0 deletions

View file

@ -50,6 +50,12 @@ class PeopleController < ApplicationController
def show def show
@person = Person.where(:id => params[:id]).first @person = Person.where(:id => params[:id]).first
if @person && @person.remote? && !user_signed_in?
render :file => "#{Rails.root}/public/404.html", :layout => false, :status => 404
return
end
@post_type = :all @post_type = :all
@aspect = :profile @aspect = :profile
@share_with = (params[:share_with] == 'true') @share_with = (params[:share_with] == 'true')

View file

@ -154,6 +154,13 @@ describe PeopleController do
assigns[:posts].should =~ public_posts assigns[:posts].should =~ public_posts
end end
it 'throws 404 if the person is remote' do
p = Factory(:person)
get :show, :id => p.id
response.status.should == 404
end
end end
context "when the person is a contact of the current user" do context "when the person is a contact of the current user" do
before do before do