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
ff86ca7e
Commit
ff86ca7e
authored
May 01, 2018
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
For HTTP/1.1 requests, Host is mandatory
The check is added to the builtin logic for now. Fixes #2631.
parent
acaa2d40
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
builtin.vcl
bin/varnishd/builtin.vcl
+8
-2
r02633.vtc
bin/varnishtest/tests/r02633.vtc
+21
-0
No files found.
bin/varnishd/builtin.vcl
View file @
ff86ca7e
...
@@ -36,8 +36,14 @@ vcl 4.0;
...
@@ -36,8 +36,14 @@ vcl 4.0;
sub vcl_recv {
sub vcl_recv {
if (req.method == "PRI") {
if (req.method == "PRI") {
/* This will never happen in properly formed traffic (see: RFC7540) */
/* This will never happen in properly formed traffic (see: RFC7540) */
return (synth(405));
return (synth(405));
}
if (!req.http.host
&&
req.esi_level == 0
&&
req.proto ~ "^(?i)HTTP/1.1") {
/* In HTTP/1.1, Host is required. */
return (synth(400));
}
}
if (req.method != "GET"
&&
if (req.method != "GET"
&&
req.method != "HEAD"
&&
req.method != "HEAD"
&&
...
...
bin/varnishtest/tests/r02633.vtc
0 → 100644
View file @
ff86ca7e
varnishtest "For HTTP/1.1 requests, Host is mandatory"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {
} -start
client c1 {
txreq -proto HTTP/1.1
rxresp
expect resp.status == 200
txreq -proto HTTP/1.1 -nohost
rxresp
expect resp.status == 400
txreq -proto HTTP/1.0 -nohost
rxresp
expect resp.status == 200
} -run
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