Skip to content

Instantly share code, notes, and snippets.

use strict;
use warnings;
use JSON::XS;
use Encode;
my $json = JSON::XS->new->utf8;
my $CRLF = "\x0D\x0A";
my %users = ();
diff --git a/lib/Plack/App/File.pm b/lib/Plack/App/File.pm
index 1df4f74..8a64b98 100644
--- a/lib/Plack/App/File.pm
+++ b/lib/Plack/App/File.pm
@@ -9,7 +9,7 @@ use HTTP::Date;
use MIME::Types;
use Cwd ();
-__PACKAGE__->mk_accessors(qw( root encoding ));
+__PACKAGE__->mk_accessors(qw( root encoding followsymlinks));
#!/usr/bin/perl
use strict;
use warnings;
use Benchmark;
use Net::CIDR::Lite;
use Net::IP::Match::XS;
use Net::IP::Match::Bin;
use Net::IP::Match::Regexp;
use Net::Patricia;
ROOT_GIVEN:
given ( '/hoge' ) {
when ( m{^/h(.*)$} ) {
my $after = $1;
given ($after) {
when ( 'uga' ) {
say 'huga';
}
default {
continue ROOT_GIVEN;
package Plack::Middleware::LastModified;
use strict;
use parent qw( Plack::Middleware );
use Plack::Util;
use File::stat;
use HTTP::Date;
sub call {
my $self = shift;
my $env = shift;
package Plack::Session::State::Cookie::Session;
use strict;
use warnings;
our $VERSION = '0.01';
use parent 'Plack::Session::State::Cookie';
use Plack::Util::Accessor qw[
is_generate
diff --git a/t/01_root.t b/t/01_root.t
index 9b71585..2ce093c 100644
--- a/t/01_root.t
+++ b/t/01_root.t
@@ -3,6 +3,17 @@ use warnings;
use Plack::Test;
use Plack::Util;
use Test::More;
+use App::Prove;
+
package Plack::Middleware::Debug::Session;
use 5.008;
use strict;
use warnings;
use parent qw(Plack::Middleware::Debug::Base);
our $VERSION = '0.03';
sub process_response {
my ($self, $res, $env) = @_;
my $session = $env->{'plack.session'};
use Text::MicroTemplate::Extended;
my $mt = Text::MicroTemplate::Extended->new(
include_path => ['.'],
);
sub {
$mt->template_args({hoge => 'hoge'});
my $body = $mt->render('hoge');
return [200, [], [$body]];
}
diff --git a/lib/Plack/Middleware/StackTrace.pm b/lib/Plack/Middleware/StackTrace.pm
index bee07e2..26b09c0 100644
--- a/lib/Plack/Middleware/StackTrace.pm
+++ b/lib/Plack/Middleware/StackTrace.pm
@@ -7,6 +7,7 @@ use Plack::Util;
use Devel::StackTrace;
use Devel::StackTrace::AsHTML;
use Try::Tiny;
+use Encode;