about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/yahns/http_context.rb2
-rw-r--r--lib/yahns/server.rb3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/yahns/http_context.rb b/lib/yahns/http_context.rb
index 10be062..c02eefd 100644
--- a/lib/yahns/http_context.rb
+++ b/lib/yahns/http_context.rb
@@ -17,7 +17,7 @@ module Yahns::HttpContext # :nodoc:
   attr_accessor :qegg
   attr_accessor :queue # set right before spawning acceptors
   attr_reader :app
-  attr_reader :app_defaults
+  attr_accessor :app_defaults
   attr_writer :input_buffer_tmpdir
   attr_accessor :output_buffer_tmpdir
 
diff --git a/lib/yahns/server.rb b/lib/yahns/server.rb
index 09ddbef..d6a03f3 100644
--- a/lib/yahns/server.rb
+++ b/lib/yahns/server.rb
@@ -382,6 +382,9 @@ class Yahns::Server # :nodoc:
       ctx.__send__(:include, l.expire_mod)
       if ssl_ctx = opts[:ssl_ctx]
         ctx.__send__(:include, Yahns::OpenSSLClient)
+        env = ctx.app_defaults = ctx.app_defaults.dup
+        env['HTTPS'] = 'on' # undocumented, but Rack::Request uses this
+        env['rack.url_scheme'] = 'https'
 
         # call OpenSSL::SSL::SSLContext#setup explicitly here to detect
         # errors and avoid race conditions.  We avoid calling this in the