httpd-test-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject cvs commit: httpd-test/perl-framework/t/conf extra.conf.in
Date Fri, 02 Nov 2001 21:03:12 GMT
coar        01/11/02 13:03:12

  Modified:    perl-framework/t/conf extra.conf.in
  Added:       perl-framework/t/apache limits.t
  Log:
  Test the LimitRequest* directives
  
  Revision  Changes    Path
  1.1                  httpd-test/perl-framework/t/apache/limits.t
  
  Index: limits.t
  ===================================================================
  #
  # Test the LimitRequestLine, LimitRequestFieldSize, LimitRequestFields,
  # and LimitRequestBody directives.
  #
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  use Apache::TestRequest;
  
  #
  # These values are chosen to exceed the limits in extra.conf, namely:
  #
  # LimitRequestLine      128
  # LimitRequestFieldSize 1024
  # LimitRequestFields    32
  # LimitRequestBody      10250000
  #
  
  my $fail_requestline = "/" . ('a' x 256);
  my $fail_fieldsize   = ('a' x 2048);
  my %fail_fieldcount;
  my $fail_bodysize    = 'a' x 10260000;
  
  my $res;
  
  #
  # Change to '3' when we get the fieldcount test working.
  #
  plan tests => 2;
  
  $res = GET_RC($fail_requestline);
  print "# Testing too-long request line\n",
        "#  Expecting status: 414\n",
        "#  Received status:  $res\n";
  ok $res == 414;
  
  $res = GET_RC('/', 'X-overflow-field' => $fail_fieldsize);
  print "# Testing too-long request header field\n",
        "#  Expecting status: 400\n",
        "#  Received status:  $res\n";
  ok $res == 400;
  
  if (0) {
  for (my $i = 1; $i < 65; $i++) {
      $fail_fieldcount{'X-Field$i'} = 'Testing field $i';
  }
  $res = GET_RC('/', \%fail_fieldcount);
  print "# Testing too many request header fields\n",
        "#  Expecting status: 414\n",
        "#  Received status:  $res\n";
  ok $res == 414;
  }
  
  
  
  1.26      +11 -0     httpd-test/perl-framework/t/conf/extra.conf.in
  
  Index: extra.conf.in
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/t/conf/extra.conf.in,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -u -r1.25 -r1.26
  --- extra.conf.in	2001/09/16 23:25:49	1.25
  +++ extra.conf.in	2001/11/02 21:03:12	1.26
  @@ -297,3 +297,14 @@
           AllowOverride Indexes
       </Directory>
   </IfModule>
  +
  +##
  +## apache/limits.t:
  +## LimitRequest* directive testing.  Note that LimitRequestBody has
  +## to be larger than apache/post.t's largest request (currently 10MB),
  +## or else that test will fail falsely.
  +##
  +LimitRequestLine      128
  +LimitRequestFieldSize 1024
  +LimitRequestFields    32
  +LimitRequestBody      10250000
  
  
  

Mime
View raw message