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
5765f28e
Commit
5765f28e
authored
Feb 21, 2012
by
Lasse Karstensen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
put the development server backend and override cookie stuff into a different files
parent
9eb24d3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
devicedetect-dev.vcl
devicedetect-dev.vcl
+25
-0
No files found.
devicedetect-dev.vcl
0 → 100644
View file @
5765f28e
#
# devicedetect-dev.vcl
#
# Enable test URLs and cookie overrides
backend devicetest {
.host = "127.0.0.1";
.port = "8000";
}
sub vcl_recv {
if (req.url ~ "^/set_devicetype/") { error 701 regsub(req.url, "^/set_devicetype/", ""); }
if (req.url ~ "^/devicetest") { set backend = devicetest; }
}
sub vcl_error {
if (obj.status == 701 ) {
# obj.response == mobile-generic
set obj.http.Set-Cookie = "X-UA-device=" + obj.response;
set obj.http.Content-Type = "text/plain; charset=utf-8";
synthetic {" 200 OK, Cookie set "};
return(deliver)
}
}
"""
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