[master] bdc63fc Update device detection VCL
Federico G. Schwindt
fgsch at lodoss.net
Tue Apr 5 17:03:05 CEST 2016
commit bdc63fc38748ff6abe5f4652b62dbbd2f5a33145
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Thu Mar 31 14:57:51 2016 +0100
Update device detection VCL
diff --git a/etc/devicedetect.vcl b/etc/devicedetect.vcl
index d1a85d9..6c7e659 100644
--- a/etc/devicedetect.vcl
+++ b/etc/devicedetect.vcl
@@ -42,7 +42,7 @@ sub devicedetect {
if (req.http.User-Agent ~ "\(compatible; Googlebot-Mobile/2.1; \+http://www.google.com/bot.html\)" ||
(req.http.User-Agent ~ "iPhone" && req.http.User-Agent ~ "\(compatible; Googlebot/2.1; \+http://www.google.com/bot.html")) {
set req.http.X-UA-Device = "mobile-bot"; }
- elsif (req.http.User-Agent ~ "(?i)(ads|google|bing|msn|yandex|baidu|ro|career|)bot" ||
+ elsif (req.http.User-Agent ~ "(?i)(ads|google|bing|msn|yandex|baidu|ro|career|seznam|)bot" ||
req.http.User-Agent ~ "(?i)(baidu|jike|symantec)spider" ||
req.http.User-Agent ~ "(?i)scanner" ||
req.http.User-Agent ~ "(?i)(web)crawler") {
@@ -61,7 +61,10 @@ sub devicedetect {
elsif (req.http.User-Agent ~ "PlayBook; U; RIM Tablet") { set req.http.X-UA-Device = "tablet-rim"; }
elsif (req.http.User-Agent ~ "hp-tablet.*TouchPad") { set req.http.X-UA-Device = "tablet-hp"; }
elsif (req.http.User-Agent ~ "Kindle/3") { set req.http.X-UA-Device = "tablet-kindle"; }
- elsif (req.http.User-Agent ~ "Touch.+Tablet PC") { set req.http.X-UA-Device = "tablet-microsoft"; }
+ elsif (req.http.User-Agent ~ "Touch.+Tablet PC" ||
+ req.http.User-Agent ~ "Windows NT [0-9.]+; ARM;" ) {
+ set req.http.X-UA-Device = "tablet-microsoft";
+ }
elsif (req.http.User-Agent ~ "Mobile.+Firefox") { set req.http.X-UA-Device = "mobile-firefoxos"; }
elsif (req.http.User-Agent ~ "^HTC" ||
req.http.User-Agent ~ "Fennec" ||
More information about the varnish-commit
mailing list