Subject: | Clicking on distribution link in search results results in 500 error when 00whois.xml exists in minicpan |
If you run minicpan_webserver on a minicpan that mirrors 00whois.xml,
clicking
on a distribution link causes an HTTP 500 error. I've attached a patch
to
include a rudimentary 00whois.xml for testing, along with a fix for the
issue.
Steps to reproduce:
1) Create a minicpanrc with also_mirror: authors/00whois.xml
2) Run minicpan with that minicpanrc
3) Go grab some lunch or something
4) Run minicpan_webserver
5) Search for Plack or something that will yield results
6) Click the first distribution link
-Rob
Subject: | fix-00whois.xml.patch |
diff -Naur CPAN-Mini-Webserver-0.51/lib/CPAN/Mini/Webserver/Templates.pm CPAN-Mini-Webserver-0.51-rhoelz/lib/CPAN/Mini/Webserver/Templates.pm
--- CPAN-Mini-Webserver-0.51/lib/CPAN/Mini/Webserver/Templates.pm 2011-01-30 09:09:07.000000000 -0600
+++ CPAN-Mini-Webserver-0.51-rhoelz/lib/CPAN/Mini/Webserver/Templates.pm 2011-05-05 13:44:20.954488077 -0500
@@ -62,7 +62,7 @@
my ( $self, $author_desc, $arguments ) = @_;
my $author = $author_desc;
- $author = $arguments->{parse_cpan_authors}->author( $author_desc ) if !$author_desc->isa( 'Parse::CPAN::Authors::Author' );
+ $author = $arguments->{parse_cpan_authors}->author( $author_desc ) if !ref($author_desc);
my $name = my $pause_id = $author_desc;
$name = $author->name if $author;
diff -Naur CPAN-Mini-Webserver-0.51/t/mini/authors/00whois.xml CPAN-Mini-Webserver-0.51-rhoelz/t/mini/authors/00whois.xml
--- CPAN-Mini-Webserver-0.51/t/mini/authors/00whois.xml 1969-12-31 18:00:00.000000000 -0600
+++ CPAN-Mini-Webserver-0.51-rhoelz/t/mini/authors/00whois.xml 2011-05-05 13:46:00.033951317 -0500
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<cpan-whois xmlns='http://www.cpan.org/xmlns/whois'
+ last-generated='Tue May 3 16:19:02 2011 GMT'
+ generated-by='Id'>
+ <cpanid>
+ <id>ANDK</id>
+ <type>author</type>
+ <fullname>Andreas CpanTest K</fullname>
+ <asciiname>Andreas CpanTest K</asciiname>
+ <email>andreas.koenig.7os6vvqr@franz.ak.mind.de</email>
+ <has_cpandir>1</has_cpandir>
+ </cpanid>
+</cpan-whois>