stupid bugfix
[scpubgit/JSON-Tree-Viewer.git] / br.pl
diff --git a/br.pl b/br.pl
index 887e0df..88de96b 100644 (file)
--- a/br.pl
+++ b/br.pl
@@ -1,6 +1,7 @@
 package TB_Temp_Packname;
 
 use Web::Simple;
+use Module::Runtime qw(use_module);
 use Scalar::Util qw(blessed);
 use IO::All;
 use JSON;
@@ -19,6 +20,11 @@ sub _build_json {
 
 sub dispatch_request {
   my ($self) = @_;
+  sub (/raw/...) {
+    use_module('Plack::App::Directory')->new({
+      root => $self->root->name
+    });
+  },
   sub () {
     response_filter {
       ref($_[0][0]) eq 'HASH' ? $self->render_table($_[0][0]) : $_[0]
@@ -26,7 +32,7 @@ sub dispatch_request {
   },
   sub (/) {
     sub (?@host=) {
-      [ 302, [ 'Location', '/'.join('+', @{$_[1]}) ], [] ];
+      [ 302, [ 'Location', '/'.join('+', @{$_[1]}).'/' ], [] ];
     },
     sub () {
       $self->root_structure;