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
3bf38ded
Commit
3bf38ded
authored
Mar 25, 2016
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reject URLs containing white spaces
Refs #1862
parent
d63efb1a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
cache_http1_proto.c
bin/varnishd/cache/cache_http1_proto.c
+6
-0
r01862.vtc
bin/varnishtest/tests/r01862.vtc
+11
-0
No files found.
bin/varnishd/cache/cache_http1_proto.c
View file @
3bf38ded
...
...
@@ -382,6 +382,8 @@ htc_proto_ver(struct http *hp)
hp
->
protover
=
10
;
else
if
(
!
strcasecmp
(
hp
->
hd
[
HTTP_HDR_PROTO
].
b
,
"HTTP/1.1"
))
hp
->
protover
=
11
;
else
if
(
*
hp
->
hd
[
HTTP_HDR_PROTO
].
b
!=
'\0'
)
hp
->
protover
=
0
;
else
hp
->
protover
=
9
;
}
...
...
@@ -410,6 +412,10 @@ HTTP1_DissectRequest(struct req *req)
return
(
retval
);
}
htc_proto_ver
(
hp
);
if
(
hp
->
protover
==
0
)
{
VSLb
(
hp
->
vsl
,
SLT_Error
,
"Illegal URL or protocol"
);
return
(
400
);
}
if
(
http_CountHdr
(
hp
,
H_Host
)
>
1
)
{
VSLb
(
hp
->
vsl
,
SLT_Error
,
"Duplicate Host header"
);
...
...
bin/varnishtest/tests/r01862.vtc
0 → 100644
View file @
3bf38ded
varnishtest "Whitespace in the request URL"
server s1 "" -start
varnish v1 -vcl+backend "" -start
client c1 {
txreq -url "/foo bar"
rxresp
expect resp.status == 400
} -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