rake test error #3

Open
tnedlacer opened this Issue Aug 13, 2009 · 2 comments

Comments

Projects
None yet
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

This comment has been minimized.

Show comment
Hide comment
@KeeperPat

KeeperPat Oct 27, 2009

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

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

This comment has been minimized.

Show comment
Hide comment
@KeeperPat

KeeperPat Oct 31, 2009

I also sent a pull request with the patch.

I also sent a pull request with the patch.

johnhampton pushed a commit to topagentnetwork/prawnto that referenced this issue Jun 7, 2011

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.

johnhampton pushed a commit to topagentnetwork/prawnto that referenced this issue Jun 7, 2011

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment