Commit 6ffdab63 authored by Jasper Maes's avatar Jasper Maes

render :nothing option is deprecated, Use head method to respond with empty response body.

parent 0a42c7cb
...@@ -233,7 +233,7 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -233,7 +233,7 @@ class Projects::BlobController < Projects::ApplicationController
def validate_diff_params def validate_diff_params
if [:since, :to, :offset].any? { |key| params[key].blank? } if [:since, :to, :offset].any? { |key| params[key].blank? }
render nothing: true head :ok
end end
end end
......
...@@ -105,7 +105,7 @@ class Projects::BranchesController < Projects::ApplicationController ...@@ -105,7 +105,7 @@ class Projects::BranchesController < Projects::ApplicationController
redirect_to project_branches_path(@project), status: :see_other redirect_to project_branches_path(@project), status: :see_other
end end
format.js { render nothing: true, status: result[:return_code] } format.js { head result[:return_code] }
format.json { render json: { message: result[:message] }, status: result[:return_code] } format.json { render json: { message: result[:message] }, status: result[:return_code] }
end end
end end
......
...@@ -213,7 +213,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo ...@@ -213,7 +213,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
def rebase def rebase
RebaseWorker.perform_async(@merge_request.id, current_user.id) RebaseWorker.perform_async(@merge_request.id, current_user.id)
render nothing: true, status: :ok head :ok
end end
protected protected
......
---
title: render :nothing option is deprecated, Use head method to respond with empty
response body.
merge_request: 23311
author: Jasper Maes
type: other
...@@ -27,11 +27,11 @@ describe ControllerWithCrossProjectAccessCheck do ...@@ -27,11 +27,11 @@ describe ControllerWithCrossProjectAccessCheck do
if: -> { if_condition } if: -> { if_condition }
def index def index
render nothing: true head :ok
end end
def show def show
render nothing: true head :ok
end end
def unless_condition def unless_condition
...@@ -88,15 +88,15 @@ describe ControllerWithCrossProjectAccessCheck do ...@@ -88,15 +88,15 @@ describe ControllerWithCrossProjectAccessCheck do
if: -> { if_condition } if: -> { if_condition }
def index def index
render nothing: true head :ok
end end
def show def show
render nothing: true head :ok
end end
def edit def edit
render nothing: true head :ok
end end
def unless_condition def unless_condition
......
...@@ -10,7 +10,7 @@ describe LfsRequest do ...@@ -10,7 +10,7 @@ describe LfsRequest do
def show def show
storage_project storage_project
render nothing: true head :ok
end end
def project def project
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment