diff --git a/app/controllers/diaspora_federation/h_card_controller.rb b/app/controllers/diaspora_federation/h_card_controller.rb index 70e8821..65e700d 100644 --- a/app/controllers/diaspora_federation/h_card_controller.rb +++ b/app/controllers/diaspora_federation/h_card_controller.rb @@ -9,10 +9,12 @@ module DiasporaFederation def hcard person_hcard = DiasporaFederation.callbacks.trigger(:person_hcard_fetch, params[:guid]) - return render nothing: true, status: 404 if person_hcard.nil? - - logger.info "hcard profile request for: #{person_hcard.nickname}:#{person_hcard.guid}" - render html: person_hcard.to_html.html_safe + 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}" + render html: person_hcard.to_html.html_safe + end end end end diff --git a/app/controllers/diaspora_federation/webfinger_controller.rb b/app/controllers/diaspora_federation/webfinger_controller.rb index 22bc63a..ac9fd5a 100644 --- a/app/controllers/diaspora_federation/webfinger_controller.rb +++ b/app/controllers/diaspora_federation/webfinger_controller.rb @@ -37,10 +37,12 @@ module DiasporaFederation def legacy_webfinger person_wf = find_person_webfinger(params[:q]) if params[:q] - return render nothing: true, status: 404 if person_wf.nil? - - logger.info "webfinger profile request for: #{person_wf.acct_uri}" - render body: person_wf.to_xml, content_type: "application/xrd+xml" + if person_wf.nil? + render nothing: true, status: 404 + else + logger.info "webfinger profile request for: #{person_wf.acct_uri}" + render body: person_wf.to_xml, content_type: "application/xrd+xml" + end end private