Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: modules/adblockplusorg/files/adblockplus.org

Issue 9170066: Don't use firefox as the default user agent (Closed)
Patch Set: Created Jan. 9, 2013, 3:13 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: modules/adblockplusorg/files/adblockplus.org
===================================================================
--- a/modules/adblockplusorg/files/adblockplus.org
+++ b/modules/adblockplusorg/files/adblockplus.org
@@ -16,7 +16,10 @@
set $preferredLang en;
}
- set $user_agent "firefox";
+ set $user_agent "";
+ if ($http_user_agent ~ \bFirefox/\d+) {
Wladimir Palant 2013/01/09 18:42:08 Not Firefox/\d+ but Gecko/d+ please.
Felix Dahlke 2013/01/10 04:49:04 Done.
+ set $user_agent "firefox";
+ }
if ($http_user_agent ~ \bChrome/\d+) {
set $user_agent "chrome";
}
@@ -27,9 +30,14 @@
set $user_agent "android";
}
+ set $platform "firefox";
+ if ($user_agent) {
+ set $platform $user_agent;
+ }
+
if ($arg_a ~ ^(view|show)?$) {
- rewrite ^/(index\.html)?$ /$preferredLang/$user_agent redirect;
- rewrite ^/(\w\w(_\w\w)?)/?$ /$1/$user_agent redirect;
+ rewrite ^/(index\.html)?$ /$preferredLang/$platform redirect;
+ rewrite ^/(\w\w(_\w\w)?)/?$ /$1/$platform redirect;
}
rewrite ^/(\w\w(_\w\w)?)/installation$ /$1/ permanent;
@@ -43,7 +51,6 @@
}
set $static_uri $uri;
- set $platform $user_agent;
if ($uri ~ ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android)/?$) {
set $static_uri "/$1/";
set $platform $3;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld