Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-devicedetect
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-devicedetect
Commits
0f8e1083
Commit
0f8e1083
authored
Mar 06, 2012
by
Lasse Karstensen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forgot code for handling redirects
parent
c287db36
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
073-example3.vtc
tests/073-example3.vtc
+6
-1
No files found.
tests/073-example3.vtc
View file @
0f8e1083
...
@@ -21,7 +21,7 @@ varnish v1 -vcl+backend {
...
@@ -21,7 +21,7 @@ varnish v1 -vcl+backend {
}
}
}
}
# standard Vary handling code from previous examples.
#
Handle redirects, otherwise
standard Vary handling code from previous examples.
sub vcl_fetch {
sub vcl_fetch {
if (req.http.X-UA-Device) {
if (req.http.X-UA-Device) {
if (!beresp.http.Vary) { # no Vary at all
if (!beresp.http.Vary) { # no Vary at all
...
@@ -29,6 +29,11 @@ varnish v1 -vcl+backend {
...
@@ -29,6 +29,11 @@ varnish v1 -vcl+backend {
} elseif (beresp.http.Vary !~ "X-UA-Device") { # add to existing Vary
} elseif (beresp.http.Vary !~ "X-UA-Device") { # add to existing Vary
set beresp.http.Vary = beresp.http.Vary + ", X-UA-Device";
set beresp.http.Vary = beresp.http.Vary + ", X-UA-Device";
}
}
# will potentially show the extra address to the client. we don't want that.
# if the backend reorders the get parameters, you may need to be smarter here. (? and & ordering)
if (beresp.status == 301 || beresp.status == 302 || beresp.status == 303) {
set beresp.http.location = regsub(beresp.http.location, "[?&]devicetype=.*$", "");
}
}
}
set beresp.http.X-UA-Device = req.http.X-UA-Device;
set beresp.http.X-UA-Device = req.http.X-UA-Device;
}
}
...
...
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