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:
@@ -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
|
||||
[]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user