fix Application.pm to handle empty sub protos correctly
Matt S Trout [Mon, 30 Nov 2009 21:16:59 +0000 (21:16 +0000)]
Changes
lib/Web/Simple/Application.pm

diff --git a/Changes b/Changes
index 49f7659..037b20e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 Change log for Web::Simple
 
+  - fix dispatcher construction to recognise '' as no proto (we expected undef)
   - plackup support, as_psgi_app method
   - Fix SYNOPSIS
 
index 70339fa..f146419 100644 (file)
@@ -171,7 +171,7 @@ sub _build_dispatcher_from_spec {
   my $proto = prototype $spec;
   my $parser = $class->_build_dispatch_parser;
   my $matcher = (
-    defined($proto)
+    length($proto)
       ? $parser->parse_dispatch_specification($proto)
       : undef
   );