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
98afc234
Commit
98afc234
authored
Nov 27, 2016
by
Federico G. Schwindt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitespace after colon is optional
Fixes #2148.
parent
1b16b697
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
varnishncsa.c
bin/varnishncsa/varnishncsa.c
+5
-5
r02148.vtc
bin/varnishtest/tests/r02148.vtc
+18
-0
No files found.
bin/varnishncsa/varnishncsa.c
View file @
98afc234
...
...
@@ -803,12 +803,12 @@ static int
isprefix
(
const
char
*
str
,
const
char
*
prefix
,
const
char
*
end
,
const
char
**
next
)
{
size_t
len
;
while
(
str
<
end
&&
*
str
&&
*
prefix
&&
tolower
((
int
)
*
str
)
==
tolower
((
int
)
*
prefix
))
++
str
,
++
prefix
;
if
(
*
str
&&
*
str
!=
' '
)
len
=
strlen
(
prefix
);
if
(
end
-
str
<
len
||
strncasecmp
(
str
,
prefix
,
len
))
return
(
0
);
str
+=
len
;
if
(
next
)
{
while
(
str
<
end
&&
*
str
&&
*
str
==
' '
)
++
str
;
...
...
@@ -1010,7 +1010,7 @@ dispatch_f(struct VSL_data *vsl, struct VSL_transaction * const pt[],
if
(
isprefix
(
b
,
"Host:"
,
e
,
&
p
))
frag_line
(
0
,
p
,
e
,
&
CTX
.
frag
[
F_host
]);
else
if
(
isprefix
(
b
,
"Authorization:"
,
e
,
&
p
)
&&
isprefix
(
p
,
"basic"
,
e
,
&
p
))
isprefix
(
p
,
"basic
"
,
e
,
&
p
))
frag_line
(
0
,
p
,
e
,
&
CTX
.
frag
[
F_auth
]);
break
;
case
(
SLT_VCL_call
+
BACKEND_MARKER
):
...
...
bin/varnishtest/tests/r02148.vtc
0 → 100644
View file @
98afc234
varnishtest "Whitespace after colon is optional"
server s1 {
rxreq
txresp
} -start
varnish v1 -vcl+backend {} -start
client c1 {
txreq -hdr "Host:qux" -hdr "Authorization:Basic Zm9vOmJhcg=="
rxresp
} -run
process p1 {varnishncsa -d -n ${v1_name} -F "%u %{Host}i"} -run
shell {grep -q "foo qux" ${tmpdir}/p1/stdout}
process p2 {varnishncsa -d -n ${v1_name} -F "%r"} -run
shell {grep -q "GET http://qux/ HTTP/1.1" ${tmpdir}/p2/stdout}
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