[ic] Detecting a secure page

Kevin Walsh kevin at cursor.biz
Wed Jun 14 11:18:40 EDT 2006


Joachim Schubert <joachim at schubis-dd.de> wrote:
> Tried your patch and it's looking good. Now i have got a little more env 
> variables, especially HTTPS. [env] returns now:
> ----start----
> [snip: env dump shows more variables, but still not all]
> -----end-----
> 
> There are disadvantages with this patched Link.pm ? 
> 
Not that I can think of.  Well, Grant reported that the patch killed
his setup, but it could possibly be a typo in his manual application
of the patch.  Grant - can you double-check your patched Link.pm for
typos.

I modified the patch slightly, to remove duplicate variables (assuming
that there could be duplicates), and sent it to Grant to try.  I've
copied it below if you want to try it as well:


*** Link.pm-    Wed Jun 14 00:37:36 2006
--- Link.pm     Wed Jun 14 16:16:07 2006
***************
*** 483,489 ****

  #warn("Connection=$c");

-     my (@tmp) = keys %ENV;
      my ($str);
      my $val = '';
      my $count = 0;
--- 483,488 ----
***************
*** 558,564 ****
          my $val = $r->headers_in->{$_};
          my $k = uc $_;
          $k =~ s/-/_/g;
-         $k =~ s/-/_/g;
          $k = $header_map{$k} || "HTTP_$k";
          $header{$k} = $val;
  #warn "header $_/$k=$val\n";
--- 557,562 ----
***************
*** 572,582 ****
--- 570,585 ----
          QUERY_STRING    => $query,
          REMOTE_ADDR     => $c->remote_ip,
          %header,
+         %ENV,
      );

+     my %seen;
+
      while (@pairs) {
          my $n = shift @pairs;
          my $v = shift @pairs;
+         next if $seen{$n}++;
+
          $count++;
          $str = "$n=$v";
          $val .= length($str);

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin at cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/


More information about the interchange-users mailing list