Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
trackrdrd
Commits
9a0adf79
Commit
9a0adf79
authored
Feb 27, 2014
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modify local test VCL
parent
5e3eaaa7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
0 deletions
+52
-0
track_vcl.inc
vcl/track_vcl.inc
+52
-0
No files found.
vcl/track_vcl.inc
View file @
9a0adf79
...
@@ -79,3 +79,55 @@ sub vcl_fetch_track {
...
@@ -79,3 +79,55 @@ sub vcl_fetch_track {
}
}
}
}
sub
vcl_deliver_track
{
if
(
req
.
http
.
X
-
Trackable
)
{
# Track the response code
std
.
log
(
"track "
+
req
.
xid
+
" http_RC="
+
resp
.
status
);
if
(
resp
.
http
.
Set
-
Cookie
)
{
# extract Set-Cookie key/values as for Cookie, see above
unset
req
.
http
.
X
-
Tracking
-
Cookie
;
unset
req
.
http
.
X
-
Cookie
-
Extract
;
# track Set-Cookie BrowserId
set
req
.
http
.
X
-
Cookie
-
Extract
=
header
.
get
(
resp
.
http
.
Set
-
Cookie
,
"BrowserId"
);
if
(
req
.
http
.
X
-
Cookie
-
Extract
)
{
set
req
.
http
.
X
-
Tracking
-
Cookie
=
regsub
(
req
.
http
.
X
-
Cookie
-
Extract
,
"^.*(BrowserId\s*=\s*[0-9a-f]+).*$"
,
"
\1
"
);
}
# track Set-Cookie trackingDisabled
set
req
.
http
.
X
-
Cookie
-
Extract
=
header
.
get
(
resp
.
http
.
Set
-
Cookie
,
"trackingDisabled"
);
if
(
req
.
http
.
X
-
Cookie
-
Extract
)
{
if
(
req
.
http
.
X
-
Tracking
-
Cookie
)
{
set
req
.
http
.
X
-
Tracking
-
Cookie
=
req
.
http
.
X
-
Tracking
-
Cookie
+
";"
;
}
else
{
set
req
.
http
.
X
-
Tracking
-
Cookie
=
""
;
}
set
req
.
http
.
X
-
Tracking
-
Cookie
=
req
.
http
.
X
-
Tracking
-
Cookie
+
regsub
(
req
.
http
.
X
-
Cookie
-
Extract
,
"^.*(trackingDisabled\s*=\s*[^;]+).*$"
,
"
\1
"
);
}
if
(
req
.
http
.
X
-
Tracking
-
Cookie
)
{
std
.
log
(
"track "
+
req
.
xid
+
" http_Set-Cookie="
+
urlcode
.
encode
(
req
.
http
.
X
-
Tracking
-
Cookie
));
}
}
if
(
resp
.
http
.
Cache
-
Control
)
{
std
.
log
(
"track "
+
req
.
xid
+
" http_Cache_Control="
+
urlcode
.
encode
(
resp
.
http
.
Cache
-
Control
));
}
if
(
resp
.
http
.
Expires
)
{
std
.
log
(
"track "
+
req
.
xid
+
" http_Expires="
+
urlcode
.
encode
(
resp
.
http
.
Expires
));
}
}
}
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