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
a94e8d47
Commit
a94e8d47
authored
Jan 26, 2016
by
Guillaume Quintard
Committed by
Lasse Karstensen
Feb 17, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add https_scheme feature bit
Allow to split https URI in the request line
parent
dd758ea9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
2 deletions
+56
-2
cache_http1_proto.c
bin/varnishd/http1/cache_http1_proto.c
+6
-2
r01847.vtc
bin/varnishtest/tests/r01847.vtc
+45
-0
feature_bits.h
include/tbl/feature_bits.h
+5
-0
No files found.
bin/varnishd/http1/cache_http1_proto.c
View file @
a94e8d47
...
...
@@ -344,7 +344,7 @@ HTTP1_DissectRequest(struct http_conn *htc, struct http *hp)
{
uint16_t
retval
;
const
char
*
p
;
const
char
*
b
,
*
e
;
const
char
*
b
=
NULL
,
*
e
;
CHECK_OBJ_NOTNULL
(
htc
,
HTTP_CONN_MAGIC
);
CHECK_OBJ_NOTNULL
(
hp
,
HTTP_MAGIC
);
...
...
@@ -363,8 +363,12 @@ HTTP1_DissectRequest(struct http_conn *htc, struct http *hp)
return
(
400
);
/* RFC2616, section 5.2, point 1 */
if
(
!
strncasecmp
(
hp
->
hd
[
HTTP_HDR_URL
].
b
,
"http://"
,
7
))
{
if
(
!
strncasecmp
(
hp
->
hd
[
HTTP_HDR_URL
].
b
,
"http://"
,
7
))
b
=
e
=
hp
->
hd
[
HTTP_HDR_URL
].
b
+
7
;
else
if
(
FEATURE
(
FEATURE_HTTPS_SCHEME
)
&&
!
strncasecmp
(
hp
->
hd
[
HTTP_HDR_URL
].
b
,
"https://"
,
8
))
b
=
e
=
hp
->
hd
[
HTTP_HDR_URL
].
b
+
8
;
if
(
b
)
{
while
(
*
e
!=
'/'
&&
*
e
!=
'\0'
)
e
++
;
if
(
*
e
==
'/'
)
{
...
...
bin/varnishtest/tests/r01847.vtc
0 → 100644
View file @
a94e8d47
varnishtest "Test https_scheme parameter"
server s1 {
rxreq
expect req.url == /bar
txresp
rxreq
expect req.url == https://www.example.com/bar
txresp
} -start
varnish v1 -vcl+backend {
sub vcl_deliver {
set resp.http.rxhost = req.http.host;
set resp.http.rxurl = req.url;
}
} -start
client c1 {
txreq -url http://www.example.com/bar
rxresp
expect resp.http.rxhost == www.example.com
expect resp.http.rxurl == /bar
txreq -url https://www.example.com/bar
rxresp
expect resp.http.rxhost == ""
expect resp.http.rxurl == https://www.example.com/bar
} -run
varnish v1 -cliok "param.set feature +https_scheme"
client c1 {
txreq -url http://www.example.com/bar
rxresp
expect resp.http.rxhost == www.example.com
expect resp.http.rxurl == /bar
txreq -url https://www.example.com/bar
rxresp
expect resp.http.rxhost == www.example.com
expect resp.http.rxurl == /bar
} -run
include/tbl/feature_bits.h
View file @
a94e8d47
...
...
@@ -59,4 +59,9 @@ FEATURE_BIT(ESI_REMOVE_BOM, esi_remove_bom,
"Remove UTF-8 BOM from front of object."
"Ignore and remove the UTF-8 BOM (0xeb 0xbb 0xbf) from front of object."
)
FEATURE_BIT
(
HTTPS_SCHEME
,
https_scheme
,
"Also split https URIs"
,
"Extract host from full URI in the request line if the scheme is "
"https."
)
/*lint -restore */
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