You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-cvs@httpd.apache.org by gb...@apache.org on 2002/11/06 13:28:09 UTC

cvs commit: httpd-test/perl-framework/Apache-Test/lib/Apache TestRequest.pm

gbenson     2002/11/06 04:28:09

  Modified:    perl-framework/Apache-Test/lib/Apache TestRequest.pm
  Log:
  Content-length headers don't seem to get added to POST requests with
  empty bodies, causing httpd to return a 411 Length Required.
  
  Revision  Changes    Path
  1.73      +3 -0      httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm
  
  Index: TestRequest.pm
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestRequest.pm,v
  retrieving revision 1.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- TestRequest.pm	18 Sep 2002 21:14:58 -0000	1.72
  +++ TestRequest.pm	6 Nov 2002 12:28:09 -0000	1.73
  @@ -386,6 +386,9 @@
   
       unless ($shortcut) {
           #GET, HEAD, POST
  +        if ($r->method eq "POST" && !defined($r->header("Content-Length"))) {
  +            $r->header('Content-Length' => length($r->content));
  +        }
           $r = $UA ? $UA->request($r) : $r;
           my $proto = $r->protocol;
           if (defined($proto)) {