routes: add a new 404 page.

* Fix a bug where non-GET 404 requests weren't handled.
* Fix a bug where non-HTML 404 requests weren't handled.
* Show a random image from a specified pool on the 404 page.
This commit is contained in:
evazion
2020-12-24 00:07:19 -06:00
parent 039ccfa3af
commit c17678d509
8 changed files with 76 additions and 37 deletions

View File

@@ -281,6 +281,11 @@ module Danbooru
restricted_tags + %w[censored condom nipples nude penis pussy sexually_suggestive]
end
# If present, the 404 page will show a random post from this pool.
def page_not_found_pool_id
nil
end
# Tags that are only visible to Gold+ users.
def restricted_tags
[]

View File

@@ -321,5 +321,5 @@ Rails.application.routes.draw do
get "/mock/iqdbs/similar" => "mock_services#iqdbs_similar", as: "mock_iqdbs_similar"
post "/mock/iqdbs/similar" => "mock_services#iqdbs_similar"
get "*other", :to => "static#not_found"
match "*other", to: "static#not_found", via: :all
end