]> cat aescling's git repositories - mastodon.git/commitdiff
Fix wrong HTTP status codes on error pages
authorEugen Rochko <eugen@zeonfederated.com>
Sun, 19 Mar 2017 19:03:28 +0000 (20:03 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Sun, 19 Mar 2017 19:03:28 +0000 (20:03 +0100)
app/controllers/accounts_controller.rb
app/controllers/application_controller.rb
app/controllers/stream_entries_controller.rb

index 00f8047fde655f6f7ee3e65429f69740b9c1646e..dc1aeb5ea5eeab46165fb0637a92199bd2f52f77 100644 (file)
@@ -56,6 +56,6 @@ class AccountsController < ApplicationController
   end
 
   def check_account_suspension
-    head 410 if @account.suspended?
+    gone if @account.suspended?
   end
 end
index e4b6d0fafed04d900c1a90875ec22c448f3667d4..ef9364897c911ded164cba8454fa2a5e7b7acd12 100644 (file)
@@ -51,21 +51,21 @@ class ApplicationController < ActionController::Base
   def not_found
     respond_to do |format|
       format.any  { head 404 }
-      format.html { render 'errors/404', layout: 'error' }
+      format.html { render 'errors/404', layout: 'error', status: 404 }
     end
   end
 
   def gone
     respond_to do |format|
       format.any  { head 410 }
-      format.html { render 'errors/410', layout: 'error' }
+      format.html { render 'errors/410', layout: 'error', status: 410 }
     end
   end
 
   def unprocessable_entity
     respond_to do |format|
       format.any  { head 422 }
-      format.html { render 'errors/422', layout: 'error' }
+      format.html { render 'errors/422', layout: 'error', status: 422 }
     end
   end
 
index c43d372ed364042436968921cd26903c8741161f..de38b360232813d2308523859e7e5d3a767214ac 100644 (file)
@@ -50,6 +50,6 @@ class StreamEntriesController < ApplicationController
   end
 
   def check_account_suspension
-    head 410 if @account.suspended?
+    gone if @account.suspended?
   end
 end