From 010e999092c04bd5ef9185db284a8733bc1b6ee6 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 23 Jan 2006 05:32:59 +0000 Subject: Fixed that SSL would not correctly be detected when running lighttpd/fcgi behind lighttpd w/mod_proxy (closes #3548) [stephen_purcell@yahoo.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3467 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/request_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/request_test.rb b/actionpack/test/controller/request_test.rb index f941857c48..a7623f3403 100644 --- a/actionpack/test/controller/request_test.rb +++ b/actionpack/test/controller/request_test.rb @@ -237,5 +237,17 @@ class RequestTest < Test::Unit::TestCase assert @request.xml_http_request? assert @request.xhr? end + + def test_reports_ssl + assert !@request.ssl? + @request.env['HTTPS'] = 'on' + assert @request.ssl? + end + + def test_reports_ssl_when_proxied_via_lighttpd + assert !@request.ssl? + @request.env['HTTP_X_FORWARDED_PROTO'] = 'https' + assert @request.ssl? + end end -- cgit v1.2.3