changeset 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 1d3c82227a05
children 390588796411
files limit-req.t ssi.t
diffstat 2 files changed, 26 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/limit-req.t	Tue May 05 00:56:35 2009 +0400
+++ b/limit-req.t	Tue May 26 17:21:59 2009 +0400
@@ -29,6 +29,7 @@
 daemon         off;
 
 events {
+    use select;
 }
 
 http {
--- a/ssi.t	Tue May 05 00:56:35 2009 +0400
+++ b/ssi.t	Tue May 26 17:21:59 2009 +0400
@@ -21,7 +21,7 @@
 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 @@
     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('/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');
+
+}
+
 ###############################################################################