mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-09-12 07:10:07 +02:00
Detect Google Mediapartners browser.
This commit is contained in:
parent
e76a2372d0
commit
3f2b343a06
@ -99,6 +99,13 @@ public class UserAgent implements Serializable {
|
|||||||
// Format ApplicationName/ApplicationVersion ();
|
// Format ApplicationName/ApplicationVersion ();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
|
// Mediapartners-Google -> Add sense robot
|
||||||
|
if(userAgentHeader.equals("Mediapartners-Google")){
|
||||||
|
this.product = Product.WEB_CRAWLER;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
int detailStart = userAgentHeader.indexOf('(');
|
int detailStart = userAgentHeader.indexOf('(');
|
||||||
int detailEnd = userAgentHeader.indexOf(')');
|
int detailEnd = userAgentHeader.indexOf(')');
|
||||||
|
|
||||||
@ -114,9 +121,8 @@ public class UserAgent implements Serializable {
|
|||||||
|
|
||||||
this.os = parseOS(productDetails);
|
this.os = parseOS(productDetails);
|
||||||
|
|
||||||
if (userAgentHeader.contains("Googlebot") || userAgentHeader.contains("Mediapartners-Google")) {
|
if (userAgentHeader.contains("Googlebot") || ) {
|
||||||
//"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
|
//"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"
|
||||||
// Mediapartners-Google -> Add sense robot
|
|
||||||
this.product = Product.WEB_CRAWLER;
|
this.product = Product.WEB_CRAWLER;
|
||||||
|
|
||||||
} else if (userAgentHeader.contains("MSIE")) {
|
} else if (userAgentHeader.contains("MSIE")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user