diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/attachments_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/boards_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/custom_fields_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/enumerations_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/issue_relations_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/issue_statuses_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/issues_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/mail_handler_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/members_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/my_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/repositories_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/roles_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/sys_controller.rb | 12 | ||||
-rw-r--r-- | app/controllers/timelog_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/trackers_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/watchers_controller.rb | 8 |
16 files changed, 33 insertions, 33 deletions
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index db95d5df4..90c3c7070 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -93,7 +93,7 @@ class AttachmentsController < ApplicationController end else # No thumbnail for the attachment or thumbnail could not be created - head 404 + head :not_found end end @@ -101,7 +101,7 @@ class AttachmentsController < ApplicationController # Make sure that API users get used to set this content type # as it won't trigger Rails' automatic parsing of the request body for parameters unless request.media_type == 'application/octet-stream' - head 406 + head :not_acceptable return end diff --git a/app/controllers/boards_controller.rb b/app/controllers/boards_controller.rb index 5782a2f60..194f5b773 100644 --- a/app/controllers/boards_controller.rb +++ b/app/controllers/boards_controller.rb @@ -93,12 +93,12 @@ class BoardsController < ApplicationController flash[:notice] = l(:notice_successful_update) redirect_to_settings_in_projects end - format.js {head 200} + format.js {head :ok} end else respond_to do |format| format.html {render :action => 'edit'} - format.js {head 422} + format.js {head :unprocessable_entity} end end end diff --git a/app/controllers/custom_fields_controller.rb b/app/controllers/custom_fields_controller.rb index fed45d3ea..68eeb6e12 100644 --- a/app/controllers/custom_fields_controller.rb +++ b/app/controllers/custom_fields_controller.rb @@ -70,12 +70,12 @@ class CustomFieldsController < ApplicationController flash[:notice] = l(:notice_successful_update) redirect_back_or_default edit_custom_field_path(@custom_field) end - format.js {head 200} + format.js {head :ok} end else respond_to do |format| format.html {render :action => 'edit'} - format.js {head 422} + format.js {head :unprocessable_entity} end end end diff --git a/app/controllers/enumerations_controller.rb b/app/controllers/enumerations_controller.rb index 664193fa7..b4851f1e2 100644 --- a/app/controllers/enumerations_controller.rb +++ b/app/controllers/enumerations_controller.rb @@ -65,12 +65,12 @@ class EnumerationsController < ApplicationController flash[:notice] = l(:notice_successful_update) redirect_to enumerations_path end - format.js {head 200} + format.js {head :ok} end else respond_to do |format| format.html {render :action => 'edit'} - format.js {head 422} + format.js {head :unprocessable_entity} end end end diff --git a/app/controllers/issue_relations_controller.rb b/app/controllers/issue_relations_controller.rb index d487e0954..e64d9a1f7 100644 --- a/app/controllers/issue_relations_controller.rb +++ b/app/controllers/issue_relations_controller.rb @@ -29,7 +29,7 @@ class IssueRelationsController < ApplicationController @relations = @issue.relations respond_to do |format| - format.html {head 200} + format.html {head :ok} format.api end end @@ -38,7 +38,7 @@ class IssueRelationsController < ApplicationController raise Unauthorized unless @relation.visible? respond_to do |format| - format.html {head 200} + format.html {head :ok} format.api end end diff --git a/app/controllers/issue_statuses_controller.rb b/app/controllers/issue_statuses_controller.rb index 1048417a5..0d6e2199e 100644 --- a/app/controllers/issue_statuses_controller.rb +++ b/app/controllers/issue_statuses_controller.rb @@ -61,12 +61,12 @@ class IssueStatusesController < ApplicationController flash[:notice] = l(:notice_successful_update) redirect_to issue_statuses_path(:page => params[:page]) end - format.js {head 200} + format.js {head :ok} end else respond_to do |format| format.html {render :action => 'edit'} - format.js {head 422} + format.js {head :unprocessable_entity} end end end diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index b449d9ee9..76e7ed921 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -84,7 +84,7 @@ class IssuesController < ApplicationController else respond_to do |format| format.html {render :layout => !request.xhr?} - format.any(:atom, :csv, :pdf) {head 422} + format.any(:atom, :csv, :pdf) {head :unprocessable_entity} format.api {render_validation_errors(@query)} end end diff --git a/app/controllers/mail_handler_controller.rb b/app/controllers/mail_handler_controller.rb index ca1468aac..bf871599e 100644 --- a/app/controllers/mail_handler_controller.rb +++ b/app/controllers/mail_handler_controller.rb @@ -70,7 +70,7 @@ class MailHandlerController < ActionController::Base def check_credential User.current = nil unless Setting.mail_handler_api_enabled? && secure_compare(params[:key].to_s, Setting.mail_handler_api_key.to_s) - render :plain => 'Access denied. Incoming emails WS is disabled or key is invalid.', :status => 403 + render :plain => 'Access denied. Incoming emails WS is disabled or key is invalid.', :status => :forbidden end end end diff --git a/app/controllers/members_controller.rb b/app/controllers/members_controller.rb index 239a48978..8d4f64bab 100644 --- a/app/controllers/members_controller.rb +++ b/app/controllers/members_controller.rb @@ -36,14 +36,14 @@ class MembersController < ApplicationController @members = scope.includes(:principal, :roles).order(:id).limit(@limit).offset(@offset).to_a respond_to do |format| - format.html {head 406} + format.html {head :not_acceptable} format.api end end def show respond_to do |format| - format.html {head 406} + format.html {head :not_acceptable} format.api end end diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index e30ae093c..01fe3995c 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -195,6 +195,6 @@ class MyController < ApplicationController @user = User.current @user.pref.order_blocks params[:group], params[:blocks] @user.pref.save - head 200 + head :ok end end diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 8deb35404..08fa8c2d1 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -89,7 +89,7 @@ class RepositoriesController < ApplicationController @entries = @repository.entries(@path, @rev) @changeset = @repository.find_changeset_by_name(@rev) if request.xhr? - @entries ? render(:partial => 'dir_list_content') : head(200) + @entries ? render(:partial => 'dir_list_content') : head(:ok) else (show_error_not_found; return) unless @entries @changesets = @repository.latest_changesets(@path, @rev) diff --git a/app/controllers/roles_controller.rb b/app/controllers/roles_controller.rb index 3b4fe1b30..f81144a5c 100644 --- a/app/controllers/roles_controller.rb +++ b/app/controllers/roles_controller.rb @@ -85,12 +85,12 @@ class RolesController < ApplicationController flash[:notice] = l(:notice_successful_update) redirect_to roles_path(:page => params[:page]) end - format.js {head 200} + format.js {head :ok} end else respond_to do |format| format.html {render :action => 'edit'} - format.js {head 422} + format.js {head :unprocessable_entity} end end end diff --git a/app/controllers/sys_controller.rb b/app/controllers/sys_controller.rb index f5e333554..7e785f951 100644 --- a/app/controllers/sys_controller.rb +++ b/app/controllers/sys_controller.rb @@ -37,16 +37,16 @@ class SysController < ActionController::Base def create_project_repository project = Project.find(params[:id]) if project.repository - head 409 + head :conflict else logger.info "Repository for #{project.name} was reported to be created by #{request.remote_ip}." repository = Repository.factory(params[:vendor]) repository.safe_attributes = params[:repository] repository.project = project if repository.save - render :json => {repository.class.name.underscore.tr('/', '-') => {:id => repository.id, :url => repository.url}}, :status => 201 + render :json => {repository.class.name.underscore.tr('/', '-') => {:id => repository.id, :url => repository.url}}, :status => :created else - head 422 + head :unprocessable_entity end end end @@ -72,9 +72,9 @@ class SysController < ActionController::Base repository.fetch_changesets end end - head 200 + head :ok rescue ActiveRecord::RecordNotFound - head 404 + head :not_found end protected @@ -82,7 +82,7 @@ class SysController < ActionController::Base def check_enabled User.current = nil unless Setting.sys_api_enabled? && secure_compare(params[:key].to_s, Setting.sys_api_key.to_s) - render :plain => 'Access denied. Repository management WS is disabled or key is invalid.', :status => 403 + render :plain => 'Access denied. Repository management WS is disabled or key is invalid.', :status => :forbidden return false end end diff --git a/app/controllers/timelog_controller.rb b/app/controllers/timelog_controller.rb index a7ad7d8a6..13c8ff26a 100644 --- a/app/controllers/timelog_controller.rb +++ b/app/controllers/timelog_controller.rb @@ -90,7 +90,7 @@ class TimelogController < ApplicationController def show respond_to do |format| # TODO: Implement html response - format.html {head 406} + format.html {head :not_acceptable} format.api end end diff --git a/app/controllers/trackers_controller.rb b/app/controllers/trackers_controller.rb index c8624c398..95cdcbc8f 100644 --- a/app/controllers/trackers_controller.rb +++ b/app/controllers/trackers_controller.rb @@ -73,7 +73,7 @@ class TrackersController < ApplicationController flash[:notice] = l(:notice_successful_update) redirect_to trackers_path(:page => params[:page]) end - format.js {head 200} + format.js {head :ok} end else respond_to do |format| @@ -81,7 +81,7 @@ class TrackersController < ApplicationController edit render :action => 'edit' end - format.js {head 422} + format.js {head :unprocessable_entity} end end end diff --git a/app/controllers/watchers_controller.rb b/app/controllers/watchers_controller.rb index 0f566e7f5..4113464bc 100644 --- a/app/controllers/watchers_controller.rb +++ b/app/controllers/watchers_controller.rb @@ -57,7 +57,7 @@ class WatchersController < ApplicationController respond_to do |format| format.html do redirect_to_referer_or do - render(:html => 'Watcher added.', :status => 200, :layout => true) + render(:html => 'Watcher added.', :status => :ok, :layout => true) end end format.js {@users = users_for_new_watcher} @@ -71,7 +71,7 @@ class WatchersController < ApplicationController @users = Principal.assignable_watchers.where(:id => user_ids).to_a end if @users.blank? - head 200 + head :ok end end @@ -83,7 +83,7 @@ class WatchersController < ApplicationController respond_to do |format| format.html do redirect_to_referer_or do - render(:html => 'Watcher removed.', :status => 200, :layout => true) + render(:html => 'Watcher removed.', :status => :ok, :layout => true) end end format.js @@ -132,7 +132,7 @@ class WatchersController < ApplicationController format.html do text = watching ? 'Watcher added.' : 'Watcher removed.' redirect_to_referer_or do - render(:html => text, :status => 200, :layout => true) + render(:html => text, :status => :ok, :layout => true) end end format.js do |