refactor controller when person is not found
This commit is contained in:
parent
da81c2e587
commit
03c94bc344
2 changed files with 12 additions and 8 deletions
|
|
@ -9,10 +9,12 @@ module DiasporaFederation
|
||||||
def hcard
|
def hcard
|
||||||
person_hcard = DiasporaFederation.callbacks.trigger(:person_hcard_fetch, params[:guid])
|
person_hcard = DiasporaFederation.callbacks.trigger(:person_hcard_fetch, params[:guid])
|
||||||
|
|
||||||
return render nothing: true, status: 404 if person_hcard.nil?
|
if person_hcard.nil?
|
||||||
|
render nothing: true, status: 404 if person_hcard.nil?
|
||||||
|
else
|
||||||
logger.info "hcard profile request for: #{person_hcard.nickname}:#{person_hcard.guid}"
|
logger.info "hcard profile request for: #{person_hcard.nickname}:#{person_hcard.guid}"
|
||||||
render html: person_hcard.to_html.html_safe
|
render html: person_hcard.to_html.html_safe
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
|
||||||
|
|
@ -37,11 +37,13 @@ module DiasporaFederation
|
||||||
def legacy_webfinger
|
def legacy_webfinger
|
||||||
person_wf = find_person_webfinger(params[:q]) if params[:q]
|
person_wf = find_person_webfinger(params[:q]) if params[:q]
|
||||||
|
|
||||||
return render nothing: true, status: 404 if person_wf.nil?
|
if person_wf.nil?
|
||||||
|
render nothing: true, status: 404
|
||||||
|
else
|
||||||
logger.info "webfinger profile request for: #{person_wf.acct_uri}"
|
logger.info "webfinger profile request for: #{person_wf.acct_uri}"
|
||||||
render body: person_wf.to_xml, content_type: "application/xrd+xml"
|
render body: person_wf.to_xml, content_type: "application/xrd+xml"
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue