[EMAIL PROTECTED] said:
:- Do we know how that Perl library is implemented? It is probably
:- looking for CGI environment variables in a slightly different way than
:- I do things in TclHttpd. I'd love for someone to dig into this and
:- make sure we are compatible with Perl CGI scripts. 

I tracked this down some and send a bug report to the CGI.pm maintainer,
cuz it looked like a bug to me.  That report is attached.

What is happening is that REQUEST_URI is getting slapped in
the middle of the url verbatim.

Perhaps one compatibility issue is what exactly REQUEST_URI is 
supposed to contain?



Hi:

I think I've discovered a bug in the url method of CGI.pm.  The
symptom is that running script below, I get a garbled returned url:

  CGI version: 2.68
  CGI->url(): http://www.xxx.comhttp://www.xxx.com/cgi-bin/cgitest.cgi

when using this on the Tclhttpd web server, but (the correct)

  CGI version: 2.68
  CGI->url(): http://www.xxx.com/bcc/cgi-bin/cgitest.cgi

when using apache.

I've narrowed this down to this piece of code:

    if (exists($ENV{REQUEST_URI})) {
    ...
    } else {
        $script_name = $self->script_name;
    }

For this server REQUEST_UIR is http://www.xxx.com/cgi-bin/cgitest.cgi, and 
that is the value in $script_name after this section of code completes.
Later, this value is used to construct the garbled url.

:- the version of CGI.pm (perl -MCGI -e 'print $CGI::VERSION') 

  2.68

:- the version of Perl (perl -v) 

  This is perl, v5.6.0 built for sun4-solaris

:- the name and version of your Web server 

  Tcl-Webserver/3.0.3 June 14, 2000

:- the name and version of the operating system you are using 

  SunOS 5.5.1

:- a short test script that reproduces the problem (30 lines or less) 

  #!/usr/local/bin/perl

  use CGI qw/:standard/;

  $cgi = new CGI;
  $cgiUrl = $cgi->url();

  print header;
  print start_html('CGI->url bug demo');
  print h2("CGI version: ".$CGI::VERSION);
  print h2("CGI->url(): ".$cgiUrl);
  print end_html;

Thanks!

-- 
Robert Withrow -- (+1 978 288 8256)
[EMAIL PROTECTED]



Robert Withrow -- (+1 978 288 8256)
[EMAIL PROTECTED]

Reply via email to