Skip to content

Commit

Permalink
Merge branch 'move-default-response-to-a-constant' of https://github.…
Browse files Browse the repository at this point in the history
…com/Erol/hanami-router into Erol-move-default-response-to-a-constant
  • Loading branch information
jodosha committed May 20, 2016
2 parents 3e419d9 + 9c140ed commit 2c4fbdf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/hanami/routing/endpoint_resolver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class EndpointResolver
# @api private
NAMING_PATTERN = '%{controller}::%{action}'.freeze

# @since x.x.x
# @api private
DEFAULT_RESPONSE = [404, {'X-Cascade' => 'pass'}, 'Not Found'].freeze

# Default separator for controller and action.
# A different separator can be passed to #initialize with the `:separator` option.
#
Expand Down Expand Up @@ -178,7 +182,7 @@ def find(options)
protected
def default
@endpoint_class.new(
->(env) { [404, {'X-Cascade' => 'pass'}, 'Not Found'] }
->(env) { DEFAULT_RESPONSE }
)
end

Expand Down

0 comments on commit 2c4fbdf

Please sign in to comment.