diff --git a/app/controllers/diaspora_federation/fetch_controller.rb b/app/controllers/diaspora_federation/fetch_controller.rb index 13b682f..de5d651 100644 --- a/app/controllers/diaspora_federation/fetch_controller.rb +++ b/app/controllers/diaspora_federation/fetch_controller.rb @@ -17,7 +17,7 @@ module DiasporaFederation entity.author, "/fetch/#{params[:type]}/#{params[:guid]}") end else - render nothing: true, status: 404 + head :not_found end end diff --git a/app/controllers/diaspora_federation/h_card_controller.rb b/app/controllers/diaspora_federation/h_card_controller.rb index abcc1b5..b7d2f2e 100644 --- a/app/controllers/diaspora_federation/h_card_controller.rb +++ b/app/controllers/diaspora_federation/h_card_controller.rb @@ -10,7 +10,7 @@ module DiasporaFederation person_hcard = DiasporaFederation.callbacks.trigger(:fetch_person_for_hcard, params[:guid]) if person_hcard.nil? - render nothing: true, status: 404 + head :not_found else logger.info "hcard profile request for: #{person_hcard.nickname}:#{person_hcard.guid}" # rubocop:disable Rails/OutputSafety diff --git a/app/controllers/diaspora_federation/receive_controller.rb b/app/controllers/diaspora_federation/receive_controller.rb index 1d9956f..9155a8a 100644 --- a/app/controllers/diaspora_federation/receive_controller.rb +++ b/app/controllers/diaspora_federation/receive_controller.rb @@ -16,7 +16,7 @@ module DiasporaFederation DiasporaFederation.callbacks.trigger(:queue_public_receive, data, legacy) - render nothing: true, status: 202 + head :accepted end # Receives private messages for a user @@ -30,7 +30,7 @@ module DiasporaFederation success = DiasporaFederation.callbacks.trigger(:queue_private_receive, params[:guid], data, legacy) - render nothing: true, status: success ? 202 : 404 + head success ? :accepted : :not_found end private @@ -39,7 +39,7 @@ module DiasporaFederation # @deprecated def check_for_xml legacy_request = request.content_type.nil? || request.content_type == "application/x-www-form-urlencoded" - render nothing: true, status: 422 if params[:xml].nil? && legacy_request + head :unprocessable_entity if params[:xml].nil? && legacy_request end def data_for_public_message(legacy) diff --git a/app/controllers/diaspora_federation/webfinger_controller.rb b/app/controllers/diaspora_federation/webfinger_controller.rb index 0d1631f..0e755cd 100644 --- a/app/controllers/diaspora_federation/webfinger_controller.rb +++ b/app/controllers/diaspora_federation/webfinger_controller.rb @@ -38,7 +38,7 @@ module DiasporaFederation person_wf = find_person_webfinger(params[:q]) if params[:q] if person_wf.nil? - render nothing: true, status: 404 + head :not_found else logger.info "webfinger profile request for: #{person_wf.acct_uri}" render xml: person_wf.to_xml, content_type: "application/xrd+xml"