Permalink
Browse files

parameters panel

  • Loading branch information...
1 parent 01addd9 commit 9ccdf3458ca6af2f1342c7685bfb04ee1eea11d5 @fcuny fcuny committed Apr 18, 2010
Showing with 51 additions and 0 deletions.
  1. +51 −0 lib/Plack/Middleware/Debug/Parameters.pm
@@ -0,0 +1,51 @@
+package Plack::Middleware::Debug::Parameters;
+use strict;
+use warnings;
+use parent qw/Plack::Middleware::Debug::Base/;
+use Plack::Request;
+
+sub run {
+ my ( $self, $env, $panel ) = @_;
+ return sub {
+ my @sections = (qw/cookies get post session/);
+ my $parameters;
+ my $request = Plack::Request->new($env);
+
+ $parameters = {
+ get => $request->query_parameters,
+ cookies => $request->cookies,
+ post => $request->body_parameters,
+ session => $env->{'psgix.session'},
+ };
+ $panel->content( sub { $self->render_hash( $parameters, \@sections ) } );
+ }
+}
+
+1;
+__END__
+
+=head1 NAME
+
+Plack::Middleware::Debug::Parameters - Parameters Panel
+
+=head1 DESCRIPTION
+
+return info about:
+
+=over 4
+
+=item query parameters
+
+=item body parameters
+
+=item cookies
+
+=item session
+
+=back
+
+=head1 SEE ALSO
+
+L<Plack::Middleware::Debug>
+
+=cut

0 comments on commit 9ccdf34

Please sign in to comment.