You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2016/08/30 14:04:35 UTC

svn commit: r1758391 - in /httpd/test/framework/trunk/t/apache: chunkinput.t contentlength.t headers.t

Author: wrowe
Date: Tue Aug 30 14:04:35 2016
New Revision: 1758391

URL: http://svn.apache.org/viewvc?rev=1758391&view=rev
Log:
Examples of invalid HTTP requests, now denied, so now corrected

Modified:
    httpd/test/framework/trunk/t/apache/chunkinput.t
    httpd/test/framework/trunk/t/apache/contentlength.t
    httpd/test/framework/trunk/t/apache/headers.t

Modified: httpd/test/framework/trunk/t/apache/chunkinput.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/apache/chunkinput.t?rev=1758391&r1=1758390&r2=1758391&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/apache/chunkinput.t (original)
+++ httpd/test/framework/trunk/t/apache/chunkinput.t Tue Aug 30 14:04:35 2016
@@ -84,21 +84,21 @@ for my $data (@test_strings) {
 
     my @elts = split("::", $data);
 
-    $sock->print("POST $request_uri HTTP/1.0\n");
-    $sock->print("Transfer-Encoding: chunked\n");
-    $sock->print("\n");
+    $sock->print("POST $request_uri HTTP/1.0\r\n");
+    $sock->print("Transfer-Encoding: chunked\r\n");
+    $sock->print("\r\n");
     if (@elts > 1) {
         for my $elt (@elts) {
             $sock->print("$elt");
             sleep 0.5;
         }
-        $sock->print("\n");
+        $sock->print("\r\n");
     }
     else {
-        $sock->print("$data\n");
+        $sock->print("$data\r\n");
     }
-    $sock->print("X-Chunk-Trailer: $$\n");
-    $sock->print("\n");
+    $sock->print("X-Chunk-Trailer: $$\r\n");
+    $sock->print("\r\n");
 
     #Read the status line
     chomp(my $response = Apache::TestRequest::getline($sock));

Modified: httpd/test/framework/trunk/t/apache/contentlength.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/apache/contentlength.t?rev=1758391&r1=1758390&r2=1758391&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/apache/contentlength.t (original)
+++ httpd/test/framework/trunk/t/apache/contentlength.t Tue Aug 30 14:04:35 2016
@@ -55,10 +55,10 @@ for my $data (@test_strings) {
 
     Apache::TestRequest::socket_trace($sock);
 
-    $sock->print("POST $request_uri HTTP/1.0\n");
-    $sock->print("Content-Length: $data\n");
-    $sock->print("\n");
-    $sock->print("\n");
+    $sock->print("POST $request_uri HTTP/1.0\r\n");
+    $sock->print("Content-Length: $data\r\n");
+    $sock->print("\r\n");
+    $sock->print("\r\n");
 
     # Read the status line
     chomp(my $response = Apache::TestRequest::getline($sock) || '');

Modified: httpd/test/framework/trunk/t/apache/headers.t
URL: http://svn.apache.org/viewvc/httpd/test/framework/trunk/t/apache/headers.t?rev=1758391&r1=1758390&r2=1758391&view=diff
==============================================================================
--- httpd/test/framework/trunk/t/apache/headers.t (original)
+++ httpd/test/framework/trunk/t/apache/headers.t Tue Aug 30 14:04:35 2016
@@ -6,14 +6,14 @@ use Apache::TestUtil;
 use Apache::TestRequest;
 
 my %headers = (
-               "Hello:World\n" => ["Hello", "World"],
-#              "Hello  :  World\n" => ["Hello", "World"],
-#              "Hello  :  World   \n" => ["Hello", "World"],
-#              "Hello \t :  World  \n" => ["Hello", "World"],
-               "Hello: Foo\n Bar\n" => ["Hello", "Foo Bar"],
-               "Hello: Foo\n\tBar\n" => ["Hello", "Foo Bar"],
-               "Hello: Foo\n    Bar\n" => ["Hello", qr/Foo +Bar/],
-               "Hello: Foo \n Bar\n" => ["Hello", qr/Foo +Bar/],
+               "Hello:World\r\n" => ["Hello", "World"],
+#              "Hello  :  World\r\n" => ["Hello", "World"],
+#              "Hello  :  World   \r\n" => ["Hello", "World"],
+#              "Hello \t :  World  \r\n" => ["Hello", "World"],
+               "Hello: Foo\r\n Bar\r\n" => ["Hello", "Foo Bar"],
+               "Hello: Foo\r\n\tBar\r\n" => ["Hello", "Foo Bar"],
+               "Hello: Foo\r\n    Bar\r\n" => ["Hello", qr/Foo +Bar/],
+               "Hello: Foo \r\n Bar\r\n" => ["Hello", qr/Foo +Bar/],
                );
 
 my $uri = "/modules/cgi/env.pl";