about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-02-02 04:00:08 +0000
committerEric Wong <e@80x24.org>2016-02-02 04:07:19 +0000
commitd39a8a440c9b5c59e1fa058467f64034f8974e0e (patch)
treee91838195760216d9b3c0dda5931d3d88aa53cf6 /t
parent4c808e262750b717e27e050cecaed0a44e780aa6 (diff)
downloadpublic-inbox-d39a8a440c9b5c59e1fa058467f64034f8974e0e.tar.gz
This is enabled by default, for now.
Smart HTTP cloning support will be added later, but it will
be optional since it can be highly CPU and memory intensive.
Diffstat (limited to 't')
-rw-r--r--t/cgi.t18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/cgi.t b/t/cgi.t
index 18632cee..4ce6514c 100644
--- a/t/cgi.t
+++ b/t/cgi.t
@@ -102,6 +102,24 @@ EOF
         like($res->{head}, qr/Status:\s*404/i, "index returns 404");
 }
 
+# dumb HTTP support
+{
+        my $path = "/test/info/refs";
+        my $res = cgi_run($path);
+        like($res->{head}, qr/Status:\s*200/i, "info/refs readable");
+        my $orig = $res->{body};
+
+        local $ENV{HTTP_RANGE} = 'bytes=5-10';
+        $res = cgi_run($path);
+        like($res->{head}, qr/Status:\s*206/i, "info/refs partial OK");
+        is($res->{body}, substr($orig, 5, 6), 'partial body OK');
+
+        local $ENV{HTTP_RANGE} = 'bytes=5-';
+        $res = cgi_run($path);
+        like($res->{head}, qr/Status:\s*206/i, "info/refs partial past end OK");
+        is($res->{body}, substr($orig, 5), 'partial body OK past end');
+}
+
 # atom feeds
 {
         local $ENV{HOME} = $home;