sinatra/sinatra — pull request #768 by patriciomacadden (2013-09-15 19:21:04+00:00)
Title: Make the request accept */* when HTTP_ACCEPT is not present or blank

See #731.

When the request has no `HTTP_ACCEPT` header (or when `HTTP_ACCEPT` is blank), `accept` returns `[]` and there's no preferred type. So, when you call `accept?`, a `NoMethodErrorException` is raised.

This can be easily reproduced in irb:

```
/tmp% irb
irb(main):001:0> require 'sinatra'
=> true
irb(main):002:0> r = Sinatra::Request.new({})
=> #
irb(main):003:0> r.accept? 'text/html'
NoMethodError: undefined method `include?' for nil:NilClass
from /Users/patricio/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/sinatra-1.4.3/lib/sinatra/base.rb:31:in `accept?'
from (irb):3
from /Users/patricio/.rbenv/versions/2.0.0-p247/bin/irb:12:in `

'
irb(main):004:0>
```

I've added a two tests and fixed the issue initializing the `@env['sinatra.accept']` to '*/*' when `HTTP_ACCEPT` header is not present or blank.