Skip to content

Commit 5e1d33b

Browse files
committed
Merge branch 'empty-heads' of git://github.com/stephencelis/grape into empty-heads
2 parents 575e6fc + d40a849 commit 5e1d33b

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

lib/grape/endpoint.rb

+1
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ def run(env)
296296
def build_middleware
297297
b = Rack::Builder.new
298298

299+
b.use Rack::Head
299300
b.use Grape::Middleware::Error,
300301
:default_status => settings[:default_error_status] || 403,
301302
:rescue_all => settings[:rescue_all],

spec/grape/api_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ def app; subject end
284284
verb
285285
end
286286
send(verb, '/example')
287-
last_response.body.should eql verb
287+
last_response.body.should eql verb == 'head' ? '' : verb
288288
# Call it with a method other than the properly constrained one.
289289
send(verbs[(verbs.index(verb) + 1) % verbs.size], '/example')
290290
last_response.status.should eql 404

spec/grape/endpoint_spec.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def memoized
410410
end
411411
send(verb, '/example/and/some/more')
412412
last_response.status.should eql (verb == "post" ? 201 : 200)
413-
last_response.body.should eql verb
413+
last_response.body.should eql verb == 'head' ? '' : verb
414414
end
415415
end
416416
end

0 commit comments

Comments
 (0)