Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

rake test error #3

Open
tnedlacer opened this Issue · 2 comments

2 participants

@tnedlacer

ActionView::TemplateError: You have a nil object when you didn't expect it! The error occurred while evaluating nil.downcase

class Prawnto::TemplateHandler::CompileSupport
    def ssl_request?
        @controller.request.env['SERVER_PROTOCOL'].downcase == "https"
    end
end

to

class Prawnto::TemplateHandler::CompileSupport
    def ssl_request?
        @controller.request.env['SERVER_PROTOCOL'].to_s.downcase == "https"
    end
end
@KeeperPat

I wrote a patch to fix the method of determining whether the request is SSL or not. The way that it was done would error out in functional tests because env['SERVER_PROTOCOL'] would be nil. More importantly, this would not necessarily return true even if the request was an ssl request.

Patch is available here: http://gist.github.com/219894

@KeeperPat

I also sent a pull request with the patch.

@johnhampton johnhampton referenced this issue from a commit in cleanoffer/prawnto
@KeeperPat KeeperPat Fix the method of determining whether the request is SSL or not. The …
…way that it was done would error out in functional tests because env['SERVER_PROTOCOL'] would be nil. More importantly, this would not necessarily return true even if the request was an ssl request. Resolves #3.
d747dda
@johnhampton johnhampton referenced this issue from a commit in cleanoffer/prawnto
@KeeperPat KeeperPat Fix the method of determining whether the request is SSL or not. The …
…way that it was done would error out in functional tests because env['SERVER_PROTOCOL'] would be nil. More importantly, this would not necessarily return true even if the request was an ssl request. Resolves #3.
3ec5c8d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.