Module: Roda::RodaPlugins::NotFound::InstanceMethods

Defined in:
lib/roda/plugins/not_found.rb

Instance Method Summary collapse

Instance Method Details

#callObject

If routing returns a 404 response with an empty body, call the not_found handler.



45
46
47
48
49
50
51
52
53
54
# File 'lib/roda/plugins/not_found.rb', line 45

def call
  result = super

  if result[0] == 404 && (v = result[2]).is_a?(Array) && v.empty?
    @_response.headers.clear
    super{not_found}
  else
    result
  end
end