[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb:[2429] trunk/t/63-lwp.t
- Subject: SF.net SVN: ledger-smb:[2429] trunk/t/63-lwp.t
- From: ..hidden..
- Date: Thu, 11 Dec 2008 07:24:37 +0000
Revision: 2429
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2429&view=rev
Author: einhverfr
Date: 2008-12-11 07:24:37 +0000 (Thu, 11 Dec 2008)
Log Message:
-----------
Better support for SSL sites
Modified Paths:
--------------
trunk/t/63-lwp.t
Modified: trunk/t/63-lwp.t
===================================================================
--- trunk/t/63-lwp.t 2008-12-11 01:00:17 UTC (rev 2428)
+++ trunk/t/63-lwp.t 2008-12-11 07:24:37 UTC (rev 2429)
@@ -13,15 +13,23 @@
if ($host !~ /\/$/){
$host .= "/";
};
-$host =~ /http:\/\/([^\/]*)\//;
+$host =~ /https?:\/\/([^\/]+)\//;
$hostname = $1;
-print STDERR "hostname $hostname\n";
my $db = $ENV{LSMB_TEST_NEW_DB} || $ENV{PGDATABASE};
do 't/data/62-request-data'; # Import test case oashes
my $browser = LWP::UserAgent->new( );
-$browser->credentials("$hostname:80", 'LedgerSMB', $ENV{LSMB_USER} => $ENV{LSMB_PASS});
+if ($host !~ /https?:.+:/){
+ if ($host =~ /http:/){
+ $hport = 80;
+ } elsif ($host =~ /https:/){
+ $hport = 443;
+ }
+ $hostport = "$hostname:$hport";
+} else {
+ $hostport = "$hostname";
+}
+$browser->credentials("$hostport", 'LedgerSMB', $ENV{LSMB_USER} => $ENV{LSMB_PASS});
-$browser->credentials("$hostname:443", 'LedgerSMB', $ENV{LSMB_USER} => $ENV{LSMB_PASS});
# cookie setup
my $cookie = HTTP::Cookies->new(
"$LedgerSMB::Sysconfig::cookie_name" => "1:1:$db"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.