r4018 - in branches/2.0/varnish-cache: bin/varnishtest/tests include

tfheen at projects.linpro.no tfheen at projects.linpro.no
Wed Apr 1 14:50:29 CEST 2009


Author: tfheen
Date: 2009-04-01 14:50:29 +0200 (Wed, 01 Apr 2009)
New Revision: 4018

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

Fixes ticket #466



Copied: branches/2.0/varnish-cache/bin/varnishtest/tests/r00466.vtc (from rev 3910, trunk/varnish-cache/bin/varnishtest/tests/r00466.vtc)
===================================================================
--- branches/2.0/varnish-cache/bin/varnishtest/tests/r00466.vtc	                        (rev 0)
+++ branches/2.0/varnish-cache/bin/varnishtest/tests/r00466.vtc	2009-04-01 12:50:29 UTC (rev 4018)
@@ -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: branches/2.0/varnish-cache/include/http_headers.h
===================================================================
--- branches/2.0/varnish-cache/include/http_headers.h	2009-04-01 12:25:15 UTC (rev 4017)
+++ branches/2.0/varnish-cache/include/http_headers.h	2009-04-01 12:50:29 UTC (rev 4018)
@@ -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