Skip to content

Commit

Permalink
send text/plain as content-type instead of an empty string
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavosaume committed Feb 25, 2013
1 parent edde6c0 commit 43b321b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/grape/api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ def add_head_not_allowed_methods
not_allowed_methods = %w(GET PUT POST DELETE PATCH HEAD) - methods
not_allowed_methods << "OPTIONS" if self.class.settings[:do_not_route_options]
not_allowed_methods.each do |bad_method|
@route_set.add_route( proc { [405, { 'Allow' => allow_header, 'Content-Type' => '' }, []]}, {
@route_set.add_route( proc { [405, { 'Allow' => allow_header, 'Content-Type' => 'text/plain' }, []]}, {
:path_info => path_info,
:request_method => bad_method
})
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 @@ -403,7 +403,7 @@ def subject.enable_root_route!
"example"
end
put '/example'
last_response.headers['Content-Type'].should eql ''
last_response.headers['Content-Type'].should eql 'text/plain'
end

it 'adds an OPTIONS route that returns a 204 and an Allow header' do
Expand Down

0 comments on commit 43b321b

Please sign in to comment.