Commit 1d9d85eb authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Collect H2 cookies in H2 code, long time before we get to create req->http0.

Fixes #2300

Testcase by Simon
parent b8d06876
......@@ -799,9 +799,6 @@ cnt_recv(struct worker *wrk, struct req *req)
http_CollectHdr(req->http, H_Cache_Control);
if (req->http->protover == 20) // rfc7540,l,3114,3120
http_CollectHdrSep(req->http, H_Cookie, "; ");
if (req->req_body_status == REQ_BODY_FAIL) {
req->doclose = SC_OVERLOAD;
return (REQ_FSM_DONE);
......
......@@ -467,6 +467,12 @@ h2_do_req(struct worker *wrk, void *priv)
CAST_OBJ_NOTNULL(req, priv, REQ_MAGIC);
CAST_OBJ_NOTNULL(r2, req->transport_priv, H2_REQ_MAGIC);
THR_SetRequest(req);
// XXX: Smarter to do this already at HPACK time into tail end of
// XXX: WS, then copy back once all headers received.
// XXX: Have I mentioned H/2 Is hodge-podge ?
http_CollectHdrSep(req->http, H_Cookie, "; "); // rfc7540,l,3114,3120
req->http->conds = 1;
if (CNT_Request(wrk, req) != REQ_FSM_DISEMBARK) {
AZ(req->ws->r);
......
varnishtest "ESI Cookie"
server s1 {
fatal
rxreq
expect req.http.cookie == "Foo=Bar; B=C"
txresp -body "<html><esi:include src='/esi_test'/>"
rxreq
expect req.http.cookie == "Foo=Bar; B=C"
txresp
} -start
varnish v1 -cliok {param.set feature +http2}
varnish v1 -cliok {param.set debug +syncvsl}
varnish v1 -vcl+backend {
sub vcl_backend_response {
set beresp.do_esi = true;
}
} -start
client c1 {
stream 1 {
txreq -url "/" -hdr cookie "Foo=Bar" -hdr cookie "B=C"
rxresp
} -start
} -run
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment