Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rake test error #3

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

rake test error #3

tnedlacer opened this issue Aug 13, 2009 · 2 comments

Comments

@tnedlacer
Copy link

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
Copy link

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
Copy link

I also sent a pull request with the patch.

johnhampton pushed a commit to topagentnetwork/prawnto that referenced this issue Jun 7, 2011
…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 prior#3.
johnhampton pushed a commit to topagentnetwork/prawnto that referenced this issue Jun 7, 2011
…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 prior#3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants