Skip Menu |

This queue is for tickets about the SVN-Web CPAN distribution.

Report information
The Basics
Id: 18054
Status: resolved
Priority: 0/
Queue: SVN-Web

People
Owner: Nobody in particular
Requestors: DONGXU [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.43
Fixed in: (no value)



There is a new enviroment variable introduced in this new release version, called SCRIPT_NAME, saying that: ######################################### 783 my $base_uri = $ENV{SCRIPT_NAME}; 784 $base_uri =~ s{/index.cgi}{}; # in SVN/Web.pm sub run_cgi ######################################### No instruction found regarding this env, further I think this way should be better: ######################################### 783 my $base_uri = $ENV{SCRIPT_NAME} || q(); 784 $base_uri =~ s{/index\.cgi}{}; ######################################### Or else there is a warning against the regex substitution in case SCRIPT_NAME is not defined. BR, Dongxu
Hi, On Tue Mar 07 22:25:34 2006, DONGXU wrote: Show quoted text
> There is a new enviroment variable introduced in this new release > version, called SCRIPT_NAME, saying that: > ######################################### > 783 my $base_uri = $ENV{SCRIPT_NAME}; > 784 $base_uri =~ s{/index.cgi}{}; > # in SVN/Web.pm sub run_cgi > ######################################### > No instruction found regarding this env, further I think this way
should Show quoted text
> be better: > ######################################### > 783 my $base_uri = $ENV{SCRIPT_NAME} || q(); > 784 $base_uri =~ s{/index\.cgi}{}; > ######################################### > > Or else there is a warning against the regex substitution in case > SCRIPT_NAME is not defined.
Is this an actual problem you've encountered in production, or just hypothetical? SCRIPT_NAME is defined in the CGI1.1 specification (http://hoohoo.ncsa.uiuc.edu/cgi/env.html). The web server is supposed to always set this variable in the environment of any CGI scripts. So the code should be fine as is. Have you got any examples of where this doesn't work? N
Subject: Re: [rt.cpan.org #18054]
Date: Wed, 8 Mar 2006 17:25:12 +0800
To: bug-SVN-Web [...] rt.cpan.org
From: "Dongxu Ma" <dongxu.ma [...] gmail.com>
Sorry, I am not very familar with CGI spec;-) Just had a look about the new source code and noticed the diff. Maybe mentioning there should be a good idea for guys like me;-P On 3/8/06, via RT <bug-SVN-Web@rt.cpan.org> wrote: Show quoted text
> > Hi, > > On Tue Mar 07 22:25:34 2006, DONGXU wrote:
> > There is a new enviroment variable introduced in this new release > > version, called SCRIPT_NAME, saying that: > > ######################################### > > 783 my $base_uri = $ENV{SCRIPT_NAME}; > > 784 $base_uri =~ s{/index.cgi}{}; > > # in SVN/Web.pm sub run_cgi > > ######################################### > > No instruction found regarding this env, further I think this way
> should
> > be better: > > ######################################### > > 783 my $base_uri = $ENV{SCRIPT_NAME} || q(); > > 784 $base_uri =~ s{/index\.cgi}{}; > > ######################################### > > > > Or else there is a warning against the regex substitution in case > > SCRIPT_NAME is not defined.
> > Is this an actual problem you've encountered in production, or just > hypothetical? > > SCRIPT_NAME is defined in the CGI1.1 specification > (http://hoohoo.ncsa.uiuc.edu/cgi/env.html). The web server is supposed > to always set this variable in the environment of any CGI scripts. So > the code should be fine as is. > > Have you got any examples of where this doesn't work? > > N >
-- Cheers, Dongxu __END__ dongxu.wordpress.com search.cpan.org/~dongxu