Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/grape/endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ def run(env)
def build_middleware
b = Rack::Builder.new

b.use Rack::Head
b.use Grape::Middleware::Error,
:default_status => settings[:default_error_status] || 403,
:rescue_all => settings[:rescue_all],
Expand Down
2 changes: 1 addition & 1 deletion spec/grape/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def app; subject end
verb
end
send(verb, '/example')
last_response.body.should eql verb
last_response.body.should eql verb == 'head' ? '' : verb
# Call it with a method other than the properly constrained one.
send(verbs[(verbs.index(verb) + 1) % verbs.size], '/example')
last_response.status.should eql 404
Expand Down
2 changes: 1 addition & 1 deletion spec/grape/endpoint_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ def memoized
end
send(verb, '/example/and/some/more')
last_response.status.should eql (verb == "post" ? 201 : 200)
last_response.body.should eql verb
last_response.body.should eql verb == 'head' ? '' : verb
end
end
end
Expand Down