[4.0] e5c7502 Make sure attempts to talk (draft-)HTTP/2.0 don't confuse anybody.

Poul-Henning Kamp phk at FreeBSD.org
Tue Jun 24 11:31:56 CEST 2014


commit e5c7502defb50e8e0b5113b583c1a7e7a1365d1b
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Jun 19 07:56:37 2014 +0000

    Make sure attempts to talk (draft-)HTTP/2.0 don't confuse anybody.

diff --git a/bin/varnishd/builtin.vcl b/bin/varnishd/builtin.vcl
index f9d3527..30fcaea 100644
--- a/bin/varnishd/builtin.vcl
+++ b/bin/varnishd/builtin.vcl
@@ -45,6 +45,10 @@ vcl 4.0;
 # Client side
 
 sub vcl_recv {
+    if (req.method == "PRI") {
+	/* We do not support SPDY or HTTP/2.0 */
+	return (synth(405));
+    }
     if (req.method != "GET" &&
       req.method != "HEAD" &&
       req.method != "PUT" &&
diff --git a/include/tbl/http_headers.h b/include/tbl/http_headers.h
index 1db7784..26443ca 100644
--- a/include/tbl/http_headers.h
+++ b/include/tbl/http_headers.h
@@ -69,6 +69,7 @@ HTTPH("Expect",			H_Expect,		0					  )	/* RFC2616 14.20 */
 HTTPH("Expires",		H_Expires,		0					  )	/* RFC2616 14.21 */
 HTTPH("From",			H_From,			0					  )	/* RFC2616 14.22 */
 HTTPH("Host",			H_Host,			0					  )	/* RFC2616 14.23 */
+HTTPH("HTTP2-Settings",		H_HTTP2_Settings,	HTTPH_R_PASS | HTTPH_R_FETCH | HTTPH_A_INS)	/* draft-ietf-httpbis-http2-12.txt */
 HTTPH("If-Match",		H_If_Match,			       HTTPH_R_FETCH		  )	/* RFC2616 14.24 */
 HTTPH("If-Modified-Since",	H_If_Modified_Since,		       HTTPH_R_FETCH		  )	/* RFC2616 14.25 */
 HTTPH("If-None-Match",		H_If_None_Match,		       HTTPH_R_FETCH		  )	/* RFC2616 14.26 */



More information about the varnish-commit mailing list