Commit 936e93e6 authored by Lasse Karstensen's avatar Lasse Karstensen

Merge pull request #24 from fgsch/master

Minor updates
parents 42321e3c 74ad7dbb
...@@ -46,7 +46,7 @@ VCL:: ...@@ -46,7 +46,7 @@ VCL::
if (bereq.http.X-UA-Device) { if (bereq.http.X-UA-Device) {
if (!beresp.http.Vary) { # no Vary at all if (!beresp.http.Vary) { # no Vary at all
set beresp.http.Vary = "X-UA-Device"; set beresp.http.Vary = "X-UA-Device";
} elseif (beresp.http.Vary !~ "X-UA-Device") { # add to existing Vary } elsif (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";
} }
} }
...@@ -107,7 +107,7 @@ VCL:: ...@@ -107,7 +107,7 @@ VCL::
if (bereq.http.X-UA-Device) { if (bereq.http.X-UA-Device) {
if (!beresp.http.Vary) { # no Vary at all if (!beresp.http.Vary) { # no Vary at all
set beresp.http.Vary = "X-UA-Device"; set beresp.http.Vary = "X-UA-Device";
} elseif (beresp.http.Vary !~ "X-UA-Device") { # add to existing Vary } elsif (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";
} }
} }
...@@ -158,7 +158,7 @@ VCL:: ...@@ -158,7 +158,7 @@ VCL::
if (bereq.http.X-UA-Device) { if (bereq.http.X-UA-Device) {
if (!beresp.http.Vary) { # no Vary at all if (!beresp.http.Vary) { # no Vary at all
set beresp.http.Vary = "X-UA-Device"; set beresp.http.Vary = "X-UA-Device";
} elseif (beresp.http.Vary !~ "X-UA-Device") { # add to existing Vary } elsif (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";
} }
......
...@@ -2,7 +2,7 @@ Device detection in Varnish ...@@ -2,7 +2,7 @@ Device detection in Varnish
=========================== ===========================
The goal of this VCL set is to provide a simple & easy way of getting The goal of this VCL set is to provide a simple & easy way of getting
device detection going in Varnish Cache. (http://www.varnish-cache.org) device detection going in Varnish Cache. (https://www.varnish-cache.org)
Specific problems we want to solve: Specific problems we want to solve:
...@@ -52,7 +52,7 @@ Similar efforts ...@@ -52,7 +52,7 @@ Similar efforts
These similar efforts for User-Agent insights are known to us: These similar efforts for User-Agent insights are known to us:
* http://deviceatlas.com/ (commercial) * https://deviceatlas.com/ (commercial)
* https://github.com/OpenDDRdotORG (free) * https://github.com/OpenDDRdotORG (free)
Varnish Software has a commercial offering for DeviceAtlas lookup VMOD. Contact Varnish Software has a commercial offering for DeviceAtlas lookup VMOD. Contact
...@@ -78,7 +78,7 @@ Contact ...@@ -78,7 +78,7 @@ Contact
This project lives on Github: This project lives on Github:
http://github.com/varnish/varnish-devicedetect/ https://github.com/varnish/varnish-devicedetect/
Feature requests, bug reports and such can be added to the Github issue tracker. Feature requests, bug reports and such can be added to the Github issue tracker.
......
...@@ -54,7 +54,7 @@ sub devicedetect { ...@@ -54,7 +54,7 @@ sub devicedetect {
elsif (req.http.User-Agent ~ "(?i)android.*(mobile|mini)") { set req.http.X-UA-Device = "mobile-android"; } elsif (req.http.User-Agent ~ "(?i)android.*(mobile|mini)") { set req.http.X-UA-Device = "mobile-android"; }
// android 3/honeycomb was just about tablet-only, and any phones will probably handle a bigger page layout. // android 3/honeycomb was just about tablet-only, and any phones will probably handle a bigger page layout.
elsif (req.http.User-Agent ~ "(?i)android 3") { set req.http.X-UA-Device = "tablet-android"; } elsif (req.http.User-Agent ~ "(?i)android 3") { set req.http.X-UA-Device = "tablet-android"; }
/* see http://my.opera.com/community/openweb/idopera/ */ /* Opera Mobile */
elsif (req.http.User-Agent ~ "Opera Mobi") { set req.http.X-UA-Device = "mobile-smartphone"; } elsif (req.http.User-Agent ~ "Opera Mobi") { set req.http.X-UA-Device = "mobile-smartphone"; }
// May very well give false positives towards android tablets. Suggestions welcome. // May very well give false positives towards android tablets. Suggestions welcome.
elsif (req.http.User-Agent ~ "(?i)android") { set req.http.X-UA-Device = "tablet-android"; } elsif (req.http.User-Agent ~ "(?i)android") { set req.http.X-UA-Device = "tablet-android"; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment