Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the CGI CPAN distribution.

Report information
The Basics
Id: 89827
Status: resolved
Priority: 0/
Queue: CGI

People
Owner: Nobody in particular
Requestors: Sune.Karlsson [...] oru.se
Cc:
AdminCc:

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



X-Canit-Stats-ID: 09KGMiTyW - 92a15e437a97 - 20131029
MIME-Version: 1.0
X-Canit-Geo: ip=130.243.97.4; country=SE; region=15; city=Orebro; latitude=59.2833; longitude=15.2167; http://maps.google.com/maps?q=59.2833,15.2167&z=6
X-Spam-Flag: NO
content-type: text/plain; charset="utf-8"
X-Virus-Scanned: Debian amavisd-new at bestpractical.com
X-Spam-Score: -6.9
Received: from localhost (localhost [127.0.0.1]) by hipster.bestpractical.com (Postfix) with ESMTP id 634A82413AE for <cpan-bug+CGI.pm [...] hipster.bestpractical.com>; Mon, 28 Oct 2013 20:19:21 -0400 (EDT)
Received: from hipster.bestpractical.com ([127.0.0.1]) by localhost (hipster.bestpractical.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2aDCdYmAXmwz for <cpan-bug+CGI.pm [...] hipster.bestpractical.com>; Mon, 28 Oct 2013 20:19:19 -0400 (EDT)
Received: from la.mx.develooper.com (x1.develooper.com [207.171.7.70]) by hipster.bestpractical.com (Postfix) with SMTP id 527BD2413A8 for <bug-CGI.pm [...] rt.cpan.org>; Mon, 28 Oct 2013 20:19:19 -0400 (EDT)
Received: (qmail 7639 invoked by alias); 29 Oct 2013 00:19:18 -0000
Received: from Mailrelay1.oru.se (HELO mailrelay1.oru.se) (130.243.98.100) by la.mx.develooper.com (qpsmtpd/0.28) with ESMTP; Mon, 28 Oct 2013 17:19:08 -0700
Received: from e-mailfilter01.sunet.se (e-mailfilter01.sunet.se [192.36.171.201]) by mailrelay1.oru.se (8.14.3/8.14.3/Debian-9.4) with ESMTP id r9T0ItU0005969 for <bug-CGI.pm [...] rt.cpan.org>; Tue, 29 Oct 2013 01:18:56 +0100
Received: from brevduva02.oru.se (brevduva02.oru.se [130.243.97.11]) by e-mailfilter01.sunet.se (8.14.3/8.14.3/Debian-9.4) with ESMTP id r9T0ItR8016484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for <bug-CGI.pm [...] rt.cpan.org>; Tue, 29 Oct 2013 01:18:55 +0100
Received: from MAILHUBO01.orunet.oru.se (mail.oru.se [130.243.97.4]) by brevduva02.oru.se (8.14.3/8.14.3/Debian-9.4) with ESMTP id r9T0IrLJ009004 for <bug-CGI.pm [...] rt.cpan.org>; Tue, 29 Oct 2013 01:18:53 +0100
Received: from MAILBOXO02.orunet.oru.se ([fe80::25a7:86af:7e90:96b1]) by MAILHUBO01.orunet.oru.se ([::1]) with mapi id 14.01.0438.000; Tue, 29 Oct 2013 01:18:52 +0100
Delivered-To: cpan-bug+CGI.pm [...] hipster.bestpractical.com
Subject: url() does not behave as expected on IIS
Thread-Index: Ac7UN41jhbAUl0FCQOyLWmeVnJQNRQ==
X-Spam-Check-BY: la.mx.develooper.com
Date: Tue, 29 Oct 2013 00:18:52 +0000
X-Spam-Level:
To: "bug-CGI.pm [...] rt.cpan.org" <bug-CGI.pm [...] rt.cpan.org>
Content-Transfer-Encoding: quoted-printable
X-Scanned-BY: CanIt (www . roaringpenguin . com) on 192.36.171.201
From Sune.Karlsson [...] oru.se Mon Oct 28 20: 19:21 2013
X-Spam-Status: No, score=-6.9 tagged_above=-99.9 required=10 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5] autolearn=ham
X-Canit-Archive-Cluster: PfMRe/vJWMiXwM2YIH5BVExnUnw
Content-Language: sv-SE
Message-ID: <2C698D90F64EA847A2E7B98D0A12A97815BE7D7C [...] mailboxo02.orunet.oru.se>
X-MS-Tnef-Correlator:
Return-Path: <Sune.Karlsson [...] oru.se>
X-Original-To: cpan-bug+CGI.pm [...] hipster.bestpractical.com
X-RT-Mail-Extension: cgi.pm
Thread-Topic: url() does not behave as expected on IIS
X-MS-Has-Attach:
X-Canitpro-Stream: outbound-oru-se:outbound (inherits from outbound-oru-se:default,oru-se:default,base:default)
X-Originating-Ip: [130.243.120.66]
Accept-Language: sv-SE, en-US
From: Sune Karlsson <Sune.Karlsson [...] oru.se>
X-Bayes-Prob: 0.0001 (Score 0, tokens from: outbound, outbound-oru-se:default, oru-se:default, base:default, [...] [...] RPTN)
X-RT-Original-Encoding: iso-8859-1
X-RT-Interface: Email
Content-Length: 2144
This problem occurs with IIS6 (Windows Server 2003), IIS7 (Windows 7 and Windows Server 2008) and different versions of Perl and CGI. The following script called as http://XXX/scripts/test.pl?t=t #---- use CGI; $q = new CGI; print $q->header(); print '<html>'; print "<p>Perl version: $^V\n"; print "<p>CGI version: $CGI::VERSION\n"; print '<p>self_url: ' . $q->self_url() . "\n"; print '<p>url: ' . $q->url() . "\n"; print '<p>url(-full=>1): ' . $q->url(-full=>1) . "\n"; print '<p>url(-relative=>1): ' . $q->url(-relative=>1) . "\n"; print '<p>url(-absolute=>1): ' . $q->url(-absolute=>1) . "\n"; print '<p>url(-path_info=>1): ' . $q->url(-path_info=>1) . "\n"; print '<p>url(-path_info=>1,-query=>1): ' . $q->url(-path_info=>1,-query=>1) . "\n"; print '<p>url(-base => 1): ' . $q->url(-base => 1) . "\n"; print '</html>'; #--- Returns Perl version: v5.16.3 CGI version: 3.63 self_url: http://XXX/scripts/test.pl?t=t url: http://XXX url(-full=>1): http://XXX url(-relative=>1): url(-absolute=>1): url(-path_info=>1): http://XXX/scripts/test.pl url(-path_info=>1,-query=>1): http://XXX/scripts/test.pl?t=t url(-base => 1): http://XXX while the documentation leads me to believe that url() and url(-full=>1) should return http://XXX/scripts/test.pl, url(-relative=>1) should return test.pl and url(-absolute=>1) should return /scripts/test.pl. If the script is called with additional path information, http://XXX/scripts/test.pl/test?t=t, it behaves as expected: Perl version: v5.16.3 CGI version: 3.63 self_url: http://XXX/scripts/test.pl/scripts/test.pl/test?t=t url: http://XXX/scripts/test.pl url(-full=>1): http://XXX/scripts/test.pl url(-relative=>1): test.pl url(-absolute=>1): /scripts/test.pl url(-path_info=>1): http://XXX/scripts/test.pl/scripts/test.pl/test url(-path_info=>1,-query=>1): http://XXX/scripts/test.pl/scripts/test.pl/test?t=t url(-base => 1): http://XXX /Sune -- Sune Karlsson Professor of Statistics Handelshögskolan/Örebro University School of Business Örebro University, SE-70182 Örebro, Sweden Phone +46 19 301257/301415 http://www.oru.se/hh/sune_karlsson http://econpapers.repec.org/RAS/pka1.htm
X-RT-Interface: REST
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
RT-Message-ID: <rt-4.0.18-5432-1400761212-1326.89827-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: binary
Content-Length: 241
Download (untitled) / with headers
text/plain 241b
This issue has been copied to: https://github.com/leejo/CGI.pm/issues/126 please take all future correspondence there. This ticket will remain open but please do not reply here. This ticket will be closed when the github issue is dealt with.
MIME-Version: 1.0
In-Reply-To: <2C698D90F64EA847A2E7B98D0A12A97815BE7D7C [...] mailboxo02.orunet.oru.se>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <2C698D90F64EA847A2E7B98D0A12A97815BE7D7C [...] mailboxo02.orunet.oru.se>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.18-477-1413559250-1504.89827-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 937
Download (untitled) / with headers
text/plain 937b
After a bit of googling i believe this is a problem with IIS. Since in sub url CGI.pm does (and always has done): $uri =~ s/\Q$ENV{PATH_INFO}\E$// if defined $ENV{PATH_INFO}; PATH_INFO being the same as SCRIPT_NAME in certain configurations of IIS causes the SCRIPT_NAME to be substituted out of the uri and leads to an empty return value on -relative and -absolute. I have added a fix to prevent CGI.pm remove PATH_INFO if it is the same as SCRIPT_NAME. commit 44ab08c8397afd423c52da6c729d01818bf5d17e Author: Lee Johnson <lee@givengain.ch> Date: Fri Oct 17 17:19:04 2014 +0200 resolve #126 [rt.cpan.org #89827] - fix url PATH_INFO substitution logic to not remove PATH_INFO if it is the same as SCRIPT_NAME as some webservers (IIS) sometimes set PATH_INFO to the same value as SCRIPT_NAME Changes | 4 ++++ lib/CGI.pm | 8 +++++++- t/url.t | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletion(-)


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.