Browse Source

Fix wrong HTTP status codes on error pages

closed-social-glitch-2
Eugen Rochko 7 years ago
parent
commit
08b96f1b9f
3 changed files with 5 additions and 5 deletions
  1. +1
    -1
      app/controllers/accounts_controller.rb
  2. +3
    -3
      app/controllers/application_controller.rb
  3. +1
    -1
      app/controllers/stream_entries_controller.rb

+ 1
- 1
app/controllers/accounts_controller.rb View File

@ -56,6 +56,6 @@ class AccountsController < ApplicationController
end
def check_account_suspension
head 410 if @account.suspended?
gone if @account.suspended?
end
end

+ 3
- 3
app/controllers/application_controller.rb View 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' class="p">, 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' class="p">, 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' class="p">, status: 422 }
end
end

+ 1
- 1
app/controllers/stream_entries_controller.rb View File

@ -50,6 +50,6 @@ class StreamEntriesController < ApplicationController
end
def check_account_suspension
head 410 if @account.suspended?
gone if @account.suspended?
end
end

Loading…
Cancel
Save