Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
1d4149f2
Commit
1d4149f2
authored
Dec 12, 2017
by
Dag Haavi Finstad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
H/2: Fail streams with missing :method or :path
Fixes: #2351
parent
840e966d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
0 deletions
+55
-0
cache_http2_proto.c
bin/varnishd/http2/cache_http2_proto.c
+10
-0
r02351.vtc
bin/varnishtest/tests/r02351.vtc
+45
-0
No files found.
bin/varnishd/http2/cache_http2_proto.c
View file @
1d4149f2
...
...
@@ -536,6 +536,16 @@ h2_end_headers(struct worker *wrk, struct h2_sess *h2,
return
(
H2CE_PROTOCOL_ERROR
);
//rfc7540,l,1838,1840
}
if
(
req
->
http
->
hd
[
HTTP_HDR_METHOD
].
b
==
NULL
)
{
VSLb
(
h2
->
vsl
,
SLT_Debug
,
"Missing :method"
);
return
(
H2SE_PROTOCOL_ERROR
);
//rfc7540,l,3087,3090
}
if
(
req
->
http
->
hd
[
HTTP_HDR_URL
].
b
==
NULL
)
{
VSLb
(
h2
->
vsl
,
SLT_Debug
,
"Missing :path"
);
return
(
H2SE_PROTOCOL_ERROR
);
//rfc7540,l,3087,3090
}
AN
(
req
->
http
->
hd
[
HTTP_HDR_PROTO
].
b
);
req
->
req_step
=
R_STP_TRANSPORT
;
req
->
task
.
func
=
h2_do_req
;
req
->
task
.
priv
=
req
;
...
...
bin/varnishtest/tests/r02351.vtc
0 → 100644
View file @
1d4149f2
varnishtest "#2351: :path/:method error handling"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {} -start
varnish v1 -cliok "param.set feature +http2"
varnish v1 -cliok "param.set debug +syncvsl"
client c1 {
# missing everything
stream 1 {
txreq -noadd
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
# missing :path
stream 3 {
txreq -noadd -hdr ":authority" "example.com" -hdr ":method" "GET" -hdr ":scheme" "http"
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
# missing :method
stream 5 {
txreq -noadd -hdr ":authority" "example.com" -hdr ":path" "/foo" -hdr ":scheme" "http"
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
# Duplicate :path
stream 7 {
txreq -noadd -hdr ":path" "/" -hdr ":path" "/foo" -hdr ":method" "GET" -hdr ":authority" "example.com" -hdr ":scheme" "http"
rxrst
expect rst.err == PROTOCOL_ERROR
} -run
} -run
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment