r3910 - in trunk/varnish-cache: bin/varnishtest/tests include

phk at projects.linpro.no phk at projects.linpro.no
Wed Mar 11 12:08:12 CET 2009


Author: phk
Date: 2009-03-11 12:08:12 +0100 (Wed, 11 Mar 2009)
New Revision: 3910

Added:
   trunk/varnish-cache/bin/varnishtest/tests/r00466.vtc
Modified:
   trunk/varnish-cache/include/http_headers.h
Log:
Don't pass range header to backend on miss.

Fixes ticket #466



Added: trunk/varnish-cache/bin/varnishtest/tests/r00466.vtc
===================================================================
--- trunk/varnish-cache/bin/varnishtest/tests/r00466.vtc	                        (rev 0)
+++ trunk/varnish-cache/bin/varnishtest/tests/r00466.vtc	2009-03-11 11:08:12 UTC (rev 3910)
@@ -0,0 +1,40 @@
+# $Id$
+
+test "Check Range forwarding to backend"
+
+server s1 {
+	rxreq 
+	expect req.url == "/foo"
+	expect req.http.range == "req.http.range"
+	txresp \
+		-hdr "Foobar: _barf_" \
+		-body "012345\n"
+
+	rxreq 
+	expect req.url == "/bar"
+	expect req.http.range == "200-300"
+	txresp \
+		-status 206 \
+		-hdr "Foobar: _barf_" \
+		-body "012345\n"
+} -start
+
+varnish v1 -vcl+backend { 
+	sub vcl_recv {
+		if (req.url ~ "bar") {
+			pass;
+		}
+	}
+} -start -cliok "param.set diag_bitmap 0x10000"
+
+client c1 {
+	txreq -url "/foo" -hdr "Range: 100-200"
+	rxresp
+	expect resp.status == 200
+	expect resp.http.X-Varnish == "1001"
+
+	txreq -url "/bar" -hdr "Range: 200-300"
+	rxresp
+	expect resp.status == 206
+	expect resp.http.X-Varnish == "1002"
+} -run

Modified: trunk/varnish-cache/include/http_headers.h
===================================================================
--- trunk/varnish-cache/include/http_headers.h	2009-03-11 11:07:42 UTC (rev 3909)
+++ trunk/varnish-cache/include/http_headers.h	2009-03-11 11:08:12 UTC (rev 3910)
@@ -86,7 +86,7 @@
 HTTPH("Pragma",			H_Pragma,		1, 0, 0,										0, 0)	/* RFC2616 14.32 */
 HTTPH("Proxy-Authenticate",	H_Proxy_Authenticate,	2, 3, 				    HTTPH_R_FETCH | HTTPH_A_INS,			0, 0)	/* RFC2616 14.33 */
 HTTPH("Proxy-Authorization",	H_Proxy_Authorization,	1, 3, 				    HTTPH_R_FETCH | HTTPH_A_INS,			0, 0)	/* RFC2616 14.34 */
-HTTPH("Range",			H_Range,		1, 0, 0,										0, 0)	/* RFC2616 14.35 */
+HTTPH("Range",			H_Range,		1, 0,                  		    HTTPH_R_FETCH | HTTPH_A_INS,			0, 0)	/* RFC2616 14.35 */
 HTTPH("Referer",		H_Referer,		1, 0, 0,										0, 0)	/* RFC2616 14.36 */
 HTTPH("Retry-After",		H_Retry_After,		2, 0, 0,										0, 0)	/* RFC2616 14.37 */
 HTTPH("Server",			H_Server,		2, 0, 0,										0, 0)	/* RFC2616 14.38 */



More information about the varnish-commit mailing list