perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael.Ja...@gad.de
Subject Antwort: http or https in URL?
Date Tue, 06 Nov 2001 16:13:04 GMT

Hi,

we're using the following code:

sub savelink ($modul: string min 4 max 4, $page: string default index.html) {
  my $r = Apache->request;
  my $session_id = $r->pnotes('sessionid');

  my $uri = Apache::URI->parse($r);
  my $hostinfo = $uri->hostinfo;
  my $scheme =  $uri->scheme;

  my $url = $scheme . '://' .
            $hostinfo . '/'.
            $session_id . '/' .
            $GAD::SessionMgr::DIR_PREFIX . '/' .
            $modul . '/' .
            $page;

  return $url;
}

You may want to use
  (undef, $rest) = split '/', $r->uri, 2;
  $rest .= '?' . $r->args if $r->args;
instead of $modul and $page.

Michael


Datum:         06.11.2001 16:43
An:            modperl@apache.org


Betreff:       http or https in URL?
Nachrichtentext:

In a mod_perl handler I want to construct the original URL of the request.
I
can construct it with r->get_server_name, r->get_server_port, r->uri and
$r->parsed_uri->query.

But how do I get the protocol, http or https.  Is there a way to find out
whether SSLEngine On is set?

Yes, I can set it with "PerlSetVar protocol https", but is there a simpler
way?

Thanks in advance,
Peter
--
/"\ ASCII Ribbon Campaign
\ /
 X Against HTML
/ \ in e-mail & news






Mime
View raw message