diff ssi.t @ 91:ec89d4d65bef

Tests: Last-Modified and Accept-Ranges should be cleared on ssi. As of 0.7.44 (cache support) they are no longer cleared when got from upstream. Probably other filters (e.g. xslt) are affected as well.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 26 May 2009 17:21:59 +0400
parents c8ba98ad0570
children b8b901f86518
line wrap: on
line diff
--- a/ssi.t
+++ b/ssi.t
@@ -21,7 +21,7 @@ use Test::Nginx;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->plan(9);
+my $t = Test::Nginx->new()->plan(11);
 
 $t->write_file_expand('nginx.conf', <<'EOF');
 
@@ -42,7 +42,17 @@ http {
     server {
         listen       127.0.0.1:8080;
         server_name  localhost;
-        ssi on;
+        location / {
+            ssi on;
+        }
+        location /proxy/ {
+            ssi on;
+            proxy_pass http://127.0.0.1:8080/local/;
+        }
+        location /local/ {
+            ssi off;
+            alias %%TESTDIR%%/;
+        }
     }
 }
 
@@ -71,4 +81,17 @@ like(http_get('/test2.html'), qr/^XXtest
 
 like(http_get('/test3.html'), qr/^XtestX$/m, 'set');
 
+# Last-Modified and Accept-Ranges headers should be cleared
+
+unlike(http_get('/test1.html'), qr/Last-Modified|Accept-Ranges/im,
+	'cleared headers');
+
+TODO: {
+local $TODO = 'broken since 0.7.44';
+
+unlike(http_get('/proxy/test1.html'), qr/Last-Modified|Accept-Ranges/im,
+	'cleared headers from proxy');
+
+}
+
 ###############################################################################