Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

From: "William G. Davis" <william_gordon_davis@yahoo.com>

Subject: URI.pm not standards compliant: croaks when it shouldn't.
To: gisle@ActiveState.com
Date: Fri, 3 Oct 2003 23:29:57 -0700 (PDT)
Reply-To: william_g_davis@users.sourceforge.net

Hi Gisle.

I'm currently working on a module called Net::Gopher
(http://search.cpan.org/dist/Net-Gopher). At many
areas throughout Net::Gopher, URLs are utilized;
parsed and manipulated using URI.pm.

My problem is that URI.pm croaks with the fatal error
"Bad gopher type 'x'" if an item is denoted by an item
type character other than the 13 originally defined in
RFC 1436, even if it's a type in common usage (like
'h' for HTML, or 'M' for MIME files). While the
authors of RFC 1436 did enumerate 13 types, they
certainly did not intend for usage of the protocol be
limited to those types. See RFC 1436 pp. 10-11. Also,
this behavior prohibits usage of the additional item
types defined in Gopher+: Upward Compatible
Enhancements to the Internet Gopher Protocol.

The offending lines are in the _gopher_type() method
in gopher.pm:

>           Carp::croak("Bad gopher type '$new_type'")
>               unless $new_type =~ /^[0-9+IgT]$/;

If you could remove them from the next distribution of
URI, I would greatly appreciate it.

Thank you.
  • Loading branch information...
commit bdd19fc68204481afe3bc2f58a40df233f96a7a4 1 parent 5123cd4
@gisle gisle authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  URI/gopher.pm
View
2  URI/gopher.pm
@@ -38,7 +38,7 @@ sub _gopher_type
my $new_type = shift;
if (defined($new_type)) {
Carp::croak("Bad gopher type '$new_type'")
- unless $new_type =~ /^[0-9+IgT]$/;
+ unless length($new_type) == 1;
substr($path, 0, 0) = $new_type;
$self->path_query($path);
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.