lib/roda/plugins/not_found.rb in roda-1.3.0 vs lib/roda/plugins/not_found.rb in roda-2.0.0

- old
+ new

@@ -38,23 +38,23 @@ private :not_found end end module InstanceMethods - private - # If routing returns a 404 response with an empty body, call # the not_found handler. - def _route + 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 + + private # Use an empty not_found_handler by default, so that loading # the plugin without defining a not_found handler doesn't # break things. def not_found