Skip to content

Instantly share code, notes, and snippets.

@earino
Created July 7, 2012 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save earino/3068294 to your computer and use it in GitHub Desktop.
Save earino/3068294 to your computer and use it in GitHub Desktop.
Output from dancer printing a dump of request
<~/play/bad_upload_handler> $ perl bin/app.pl
[54114] core @0.000011> loading Dancer::Handler::Standalone handler in /Users/earino/perl5/lib/perl5/Dancer/Handler.pm l. 45
[54114] core @0.000185> loading handler 'Dancer::Handler::Standalone' in /Users/earino/perl5/lib/perl5/Dancer.pm l. 464
>> Dancer 1.3095 server 54114 listening on http://0.0.0.0:3000
== Entering the development dance floor ...
[54114] core @0.000133> request: POST / from 127.0.0.1 in /Users/earino/perl5/lib/perl5/Dancer/Handler.pm l. 56
[54114] core @0.000527> [hit #1]Trying to match 'POST /' against /^\/$/ (generated from '/') in /Users/earino/perl5/lib/perl5/Dancer/Route.pm l. 84
[54114] core @0.000678> [hit #1] --> got 1 in /Users/earino/perl5/lib/perl5/Dancer/Route.pm l. 102
[54114] debug @0.001524> [hit #1]request: $VAR1 = bless( {'_body_params' => {'born' => '1978','email' => 'earino@gmail.com','filename' => 'file.jpeg','gender' => 'M','name' => 'Eduardo Arino'},'_chunk_size' => 4096,'_http_body' => bless( {'body' => undef,'boundary' => 'xYzZY','buffer' => '','chunk_buffer' => '','chunked' => '','cleanup' => 1,'content_length' => '409','content_type' => 'multipart/form-data; boundary=xYzZY','length' => 409,'param' => {},'param_order' => ['name','email','gender','born'],'part' => {},'state' => 'done','tmpdir' => '/var/folders/z0/96cn02b13179qhqy2zgt0dzw0000gn/T','upload' => {'filename' => {'filename' => 'file.jpeg','headers' => {'Content-Disposition' => 'form-data; name="filename"; filename="file.jpeg"','Content-Type' => 'image/jpeg'},'name' => 'filename','size' => '19','tempname' => '/var/folders/z0/96cn02b13179qhqy2zgt0dzw0000gn/T/yJz_ypOQ8i.jpeg'}}}, 'HTTP::Body::MultiPart' ),'_query_params' => {},'_read_position' => 409,'_route_params' => {},'_route_pattern' => '/','accept' => undef,'accept_charset' => undef,'accept_encoding' => undef,'accept_language' => undef,'accept_type' => undef,'ajax' => 0,'body' => '--xYzZY
Content-Disposition: form-data; name="name"
Eduardo Arino
--xYzZY
Content-Disposition: form-data; name="email"
earino@gmail.com
--xYzZY
Content-Disposition: form-data; name="gender"
M
--xYzZY
Content-Disposition: form-data; name="born"
1978
--xYzZY
Content-Disposition: form-data; name="filename"; filename="file.jpeg"
Content-Type: image/jpeg
<?php phpinfo(); ?>
--xYzZY--
','connection' => 'TE, close','content_length' => '409','content_type' => 'multipart/form-data; boundary=xYzZY','env' => {'CONTENT_LENGTH' => '409','CONTENT_TYPE' => 'multipart/form-data; boundary=xYzZY','HTTP_CONNECTION' => 'TE, close','HTTP_COOKIE' => undef,'HTTP_HOST' => 'localhost:3000','HTTP_TE' => 'deflate,gzip;q=0.3','HTTP_USER_AGENT' => 'libwww-perl/6.04','PATH_INFO' => '/','QUERY_STRING' => '','REMOTE_ADDR' => '127.0.0.1','REQUEST_METHOD' => 'POST','REQUEST_URI' => '/','SCRIPT_NAME' => '','SERVER_NAME' => '0.0.0.0','SERVER_PORT' => '3000','SERVER_PROTOCOL' => 'HTTP/1.1','psgi.errors' => *::STDERR,'psgi.input' => bless( \*Symbol::GEN0, 'FileHandle' ),'psgi.multiprocess' => 0,'psgi.multithread' => 0,'psgi.nonblocking' => 0,'psgi.run_once' => 0,'psgi.streaming' => 1,'psgi.url_scheme' => 'http','psgi.version' => [1,1],'psgix.io' => do{my $o}},'headers' => bless( {'connection' => 'TE, close','content-length' => '409','content-type' => 'multipart/form-data; boundary=xYzZY','host' => 'localhost:3000','te' => 'deflate,gzip;q=0.3','user-agent' => 'libwww-perl/6.04'}, 'HTTP::Headers' ),'host' => 'localhost:3000','id' => 1,'is_forward' => 0,'keep_alive' => undef,'method' => 'POST','params' => {'born' => '1978','email' => 'earino@gmail.com','filename' => 'file.jpeg','gender' => 'M','name' => 'Eduardo Arino'},'path' => '/','path_info' => '/','referer' => undef,'uploads' => {'filename' => bless( {'filename' => 'file.jpeg','headers' => {},'size' => '19','tempname' => '/var/folders/z0/96cn02b13179qhqy2zgt0dzw0000gn/T/yJz_ypOQ8i.jpeg'}, 'Dancer::Request::Upload' )},'user_agent' => 'libwww-perl/6.04','x_requested_with' => undef}, 'Dancer::Request' );$VAR1->{'_http_body'}{'param'} = $VAR1->{'_body_params'};$VAR1->{'env'}{'psgix.io'} = $VAR1->{'env'}{'psgi.input'};$VAR1->{'uploads'}{'filename'}{'headers'} = $VAR1->{'_http_body'}{'upload'}{'filename'}{'headers'}; in /Users/earino/play/bad_upload_handler/lib/bad_upload_handler.pm l. 8
[54114] core @0.009068> [hit #1]response: 200 in /Users/earino/perl5/lib/perl5/Dancer/Handler.pm l. 179
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment