Re: how to know if i'm in HTTPS?

Shugo Maeda <[email protected]> Fri, 24 Mar 2006 13:53:24 +0900
Newsgroups gmane.comp.apache.mod-ruby
Message-ID <[email protected]>
Hi,

At 03/21/06 18:33:57 (JST),
"Pascal Damian" <[email protected]> wrote:
> How can I find out (especially in a translate_uri handler) if the
request is
> for the HTTPS server instead of HTTP? In CGI scripts I can easily
check the
> HTTPS environment variable.

You can use Apache::Request#subprocess_env.

  def translate_uri(r)
    if r.subprocess_env["HTTPS"] == "on"
      ...
    end
  end

Shugo