Fair enough. Proceed with the String then


On Tue, Sep 24, 2013 at 10:11 PM, George <notifications@github.com> wrote:

> In lib/sinatra/base.rb:
>
> > @@ -366,6 +366,7 @@ def send_file(path, opts = {})
> >        result    = file.serving env
> >        result[1].each { |k,v| headers[k] ||= v }
> >        headers['Content-Length'] = result[1]['Content-Length']
> > +      opts[:status] = opts[:status].to_i if opts[:status].is_a?(String)
>
> Seems to be too open. I can’t write the following code and pretend it to
> be semantically valid:
>
> send_file 'poem.txt', :status => 404.3141517
>
> Plus nil can be converted to integer too, thus failing a lot of tests:
>
> nil.to_i # => 0
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/sinatra/sinatra/pull/787/files#r6562523>
> .
>



-- 
To stay sane & productive, I don't live in e-mail. If you need to reach me
quickly, try this link: https://awayfind.com/blakewatters