[ic] AlwaysSecure with wildcards

Bill Carr bill at worldwideimpact.com
Tue May 29 12:47:59 EDT 2007


On May 29, 2007, at 11:46 AM, Jon Jensen wrote:

> On Tue, 29 May 2007, Bill Carr wrote:
>
>> Is there anyway to specify wildcards with the AlwaysSecure  
>> directive? For example I would like to be able to do:
>>
>> AlwaysSecure ord/* admin/*
>
> I don't believe there is. I've wanted that before and looked, but  
> didn't find it. I'd be happy to see a patch for it. :)
--- interchange-5.4.1/lib/Vend/Util.pm  2005-12-23 10:47:52.000000000  
-0500
+++ interchange/lib/Vend/Util.pm        2007-05-29 12:39:02.000000000  
-0400
@@ -1242,6 +1242,15 @@
         if($opt->{secure} or exists $Vend::Cfg->{AlwaysSecure} 
{$path}) {
                 $r = $Vend::Cfg->{SecureURL};
+       } else {
+               for my $secure_path (keys %{$Vend::Cfg-> 
{AlwaysSecure}}) {
+                       next unless $secure_path =~ /\*/;
+                       $secure_path =~ s/\*/.*/;
+                       if ($path =~ /$secure_path/) {
+                               $r = $Vend::Cfg->{SecureURL};
+                               last;
+                       }
+               }
         }
         $path = escape_chars_url($path)

Bill Carr
Bottlenose - Wine & Spirits eBusiness Specialists
(877) 857-6700
http://www.bottlenose-wine.com



More information about the interchange-users mailing list