Skip to content

Commit

Permalink
Don't assert on missing HTTP2-Settings header
Browse files Browse the repository at this point in the history
  • Loading branch information
daghf committed Jun 23, 2017
1 parent 3abbe2b commit afb5c06
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/varnishd/http2/cache_http2_session.c
Expand Up @@ -155,9 +155,9 @@ h2_b64url_settings(struct h2_sess *h2, struct req *req)
* If there is trouble with this, we could reject the upgrade
* but putting this on the H1 side is just plain wrong...
*/
AN(http_GetHdr(req->http, H_HTTP2_Settings, &p));
if (p == NULL)
if (!http_GetHdr(req->http, H_HTTP2_Settings, &p))
return (-1);
AN(p);
VSLb(req->vsl, SLT_Debug, "H2CS %s", p);

n = 0;
Expand Down
17 changes: 17 additions & 0 deletions bin/varnishtest/tests/t02001.vtc
Expand Up @@ -139,3 +139,20 @@ varnish v1 -expect MEMPOOL.req0.live == 0
varnish v1 -expect MEMPOOL.req1.live == 0
varnish v1 -expect MEMPOOL.sess0.live == 0
varnish v1 -expect MEMPOOL.sess1.live == 0


client c1 {
# Missing HTTP2-Settings
send "GET /noupgrade HTTP/1.1\r\n"
send "Host: foo.bar\r\n"
send "Upgrade: h2c\r\n"
send "\r\n"
expect_close
} -run

varnish v1 -vsl_catchup

varnish v1 -expect MEMPOOL.req0.live == 0
varnish v1 -expect MEMPOOL.req1.live == 0
varnish v1 -expect MEMPOOL.sess0.live == 0
varnish v1 -expect MEMPOOL.sess1.live == 0

0 comments on commit afb5c06

Please sign in to comment.