Query on guid, not id
This commit is contained in:
parent
9e5cf1e1a4
commit
85bae12a00
2 changed files with 5 additions and 5 deletions
|
|
@ -15,7 +15,7 @@ class PublicsController < ApplicationController
|
||||||
caches_page :host_meta
|
caches_page :host_meta
|
||||||
|
|
||||||
def hcard
|
def hcard
|
||||||
@person = Person.find_by_id params[:id]
|
@person = Person.where(:guid => params[:guid])
|
||||||
unless @person.nil? || @person.owner.nil?
|
unless @person.nil? || @person.owner.nil?
|
||||||
render 'publics/hcard'
|
render 'publics/hcard'
|
||||||
else
|
else
|
||||||
|
|
@ -48,10 +48,10 @@ class PublicsController < ApplicationController
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
person = Person.find(params[:id])
|
person = Person.where(:guid => params[:guid]).first
|
||||||
|
|
||||||
if person.owner_id.nil?
|
if person.owner_id.nil?
|
||||||
Rails.logger.error("Received post for nonexistent person #{params[:id]}")
|
Rails.logger.error("Received post for nonexistent person #{params[:guid]}")
|
||||||
render :nothing => true, :status => 404
|
render :nothing => true, :status => 404
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,9 @@ Diaspora::Application.routes.draw do
|
||||||
|
|
||||||
#public routes
|
#public routes
|
||||||
match 'webfinger', :to => 'publics#webfinger'
|
match 'webfinger', :to => 'publics#webfinger'
|
||||||
match 'hcard/users/:id', :to => 'publics#hcard'
|
match 'hcard/users/:guid', :to => 'publics#hcard'
|
||||||
match '.well-known/host-meta',:to => 'publics#host_meta'
|
match '.well-known/host-meta',:to => 'publics#host_meta'
|
||||||
match 'receive/users/:id', :to => 'publics#receive'
|
match 'receive/users/:guid', :to => 'publics#receive'
|
||||||
match 'hub', :to => 'publics#hub'
|
match 'hub', :to => 'publics#hub'
|
||||||
|
|
||||||
#root
|
#root
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue