Skip to content
This repository
Browse code

Don't restrict parsing the request body to PUT and POST requests

  • Loading branch information...
commit 0bd6314a1c1b3b1fb5d6a365866c29416b701395 1 parent 505bb86
Moritz Onken authored December 29, 2011
2  Changes
... ...
@@ -1,5 +1,7 @@
1 1
 Revision history for Perl extension Twiggy
2 2
 
  3
+        - Don't restrict parsing the request body to PUT and POST requests
  4
+
3 5
 0.1010 Mon Jan 17 17:04:14 PST 2011
4 6
         - Returning CondVar as a PSGI response is deprecated. Will be removed in the next release
5 7
 
2  lib/Twiggy/Server.pm
@@ -292,7 +292,7 @@ sub _run_app {
292 292
     my($self, $app, $env, $sock) = @_;
293 293
 
294 294
     unless ($env->{'psgi.input'}) {
295  
-        if ($env->{CONTENT_LENGTH} && $env->{REQUEST_METHOD} =~ /^(?:POST|PUT)$/) {
  295
+        if ($env->{CONTENT_LENGTH}) {
296 296
             $self->_read_chunk($sock, $env->{CONTENT_LENGTH}, sub {
297 297
                 my ($data) = @_;
298 298
                 open my $input, '<', \$data;

0 notes on commit 0bd6314

Please sign in to comment.
Something went wrong with that request. Please try again.