Gossamer Forum
Home : Products : DBMan SQL : Discussion :

GT::CGI->url() & https

Quote Reply
GT::CGI->url() & https
Hi

I have found out that GT::CGI->url(absolute => 1) doesn't return urls with https. It returns the url allways with http:// in front. Question to GT: would it be possible to implement some sort of SSL check in the next version of CGI.pm?

I'd suggest to check $ENV{HTTPS} to see if the URL has been opened using SSL.

I've tried to modify CGI.pm a bit:

Code:

if ($absolute) {
my ($protocol, $version) = split('/', $ENV{SERVER_PROTOCOL} || 'HTTP/1.0';

if ($protocol eq 'HTTP') {
if ($ENV{HTTPS} eq 'on') {
$url = "https://";
}
else { $url = "http://" };
}

else { $url = lc $protocol . "://"; }

...




Please let me know what you think about it.

Many thanks
Smileliver

Last edited by:

olivers: Nov 27, 2005, 4:14 AM