Skip to content
Extraits de code Groupes Projets
Valider dc601810 rédigé par maxwell's avatar maxwell
Parcourir les fichiers

404 googlebotz left and right on public remote person pages

parent 35bc86f6
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -50,6 +50,12 @@ class PeopleController < ApplicationController ...@@ -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')
......
...@@ -154,6 +154,13 @@ describe PeopleController do ...@@ -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
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter