Closed Bug 804642 (baidu.com) Opened 9 years ago Closed 3 years ago
.com UA sniffing serves non optimized content
baidu.com serves a static HTML site to Firefox for Android and a desktop site to Firefox OS. baidu has a much better mobile site that is served to the Android stock browser. Spoofing the UA to that of the Android stock browser results in the better mobile site being served to Firefox for Android. The site appears to be completely functional and does not appear to have layout issues.
Server side detection. To be contacted. → http -v GET http://baidu.com/ GET / HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate, compress Host: baidu.com User-Agent: HTTPie/0.7.2 HTTP/1.1 200 OK Accept-Ranges: bytes Cache-Control: max-age=86400 Connection: Keep-Alive Content-Length: 81 Content-Type: text/html Date: Fri, 25 Oct 2013 18:18:45 GMT ETag: "51-4b4c7d90" Expires: Sat, 26 Oct 2013 18:18:45 GMT Last-Modified: Tue, 12 Jan 2010 13:48:00 GMT Server: Apache <html> <meta http-equiv="refresh" content="0;url=http://www.baidu.com/"> </html> I tested with different User-Agent same response, at this level. The content varies with www.baidu.com and User-Agent. * Firefox Android - Server Apache with a content which seems to be for WAP. * Firefox OS - server BWS/1.0 with a content for desktop. * iPhone - server Apache - some content is tailored for Webkit only. * Opera Mobile (Presto) and Opera Mini - receive the WAP content # Firefox for Android → http -v GET http://www.baidu.com/ User-Agent:"$FANUA" GET / HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate, compress Host: www.baidu.com User-Agent: Mozilla/5.0 (Android; Mobile; rv:18.0) Gecko/18.0 Firefox/18.0 HTTP/1.1 200 OK Cache-Control: no-cache Connection: Keep-Alive Content-Encoding: gzip Content-type: text/html;charset=utf-8 Date: Fri, 25 Oct 2013 18:24:43 GMT P3P: CP=" OTI DSP COR IVA OUR IND COM " Server: apache Set-Cookie: BAIDUID=28A8E3E8ECA79AC521C5AEE5AE20107A:FG=1; max-age=31536000; expires=Sat, 25-Oct-14 18:24:43 GMT; domain=.baidu.com; path=/; version=1 Transfer-Encoding: chunked Vary: Accept-Encoding Version: HTTP/1.1 <!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd"> […] # Firefox OS → http -v GET http://www.baidu.com/ User-Agent:"$FOSUA" GET / HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate, compress Host: www.baidu.com User-Agent: Mozilla/5.0 (Mobile; rv:18.0) Gecko/18.0 Firefox/18.0 HTTP/1.1 200 OK BDPAGETYPE: 1 BDQID: 0xf5b5a20500a75292 BDUSERID: 0 Cache-Control: private Connection: Keep-Alive Content-Encoding: gzip Content-Length: 4389 Content-Type: text/html;charset=utf-8 Date: Fri, 25 Oct 2013 20:20:12 GMT Expires: Fri, 25 Oct 2013 20:20:12 GMT P3P: CP=" OTI DSP COR IVA OUR IND COM " Server: BWS/1.0 Set-Cookie: BDSVRTM=21; path=/ Set-Cookie: H_PS_PSSID=3593_1448_2975_2981_3644_3545_3681_3661; path=/; domain=.baidu.com Set-Cookie: BAIDUID=262D6519775C847D529D823C90E5B278:FG=1; expires=Fri, 25-Oct-43 20:20:12 GMT; path=/; domain=.baidu.com <!DOCTYPE html><!--STATUS OK--><html><head><meta http-equiv="content-type" content="text/html;charset=utf-8"><title>百度一下，你就知道</title> # iPhone → http -v GET http://www.baidu.com/ User-Agent:"$APHUA" GET / HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate, compress Host: www.baidu.com User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3 HTTP/1.1 200 OK Cache-Control: no-cache Connection: Keep-Alive Content-Encoding: gzip Content-type: text/html;charset=utf-8 Date: Fri, 25 Oct 2013 18:25:39 GMT P3P: CP=" OTI DSP COR IVA OUR IND COM " Server: apache Set-Cookie: BAIDUID=95ABF1DACA584E6BC684409502E0DCCC:FG=1; max-age=31536000; expires=Sat, 25-Oct-14 18:25:39 GMT; domain=.baidu.com; path=/; version=1 Transfer-Encoding: chunked Vary: Accept-Encoding Version: HTTP/1.1 <!DOCTYPE html> <html><!--STATUS OK--><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><meta name="viewport" content="width=device-width,minimum-scale=1.0"/><link rel="apple-touch-icon-precomposed" href="http://m.baidu.com/static/index/screen_icon.png"/><meta name="format-detection" content="telephone=no"/>
attaching screenshots for another example of Baidu sniffing - http://duokoo.baidu.com/novel/?from=1000969a (though I think the fancy site having a black background is a bug in the screenshot'ing process)
I nominate this as a sort of master bug for contacting Baidu, so I've marked the other baidu-subsite bugs as dependencies. (This isn't an empty META bug though - this bug is about the sniffing on the main baidu.com destination).
Priority: -- → P2
Whiteboard: [country-cn] [serversniff] [tier1] [contactready] → [country-cn] [serversniff] [tier1] [contactready][mentor=kdubost]
Whiteboard: [country-cn] [serversniff] [tier1] [contactready][mentor=kdubost] → [country-cn] [serversniff] [tier1] [contactready]
I have contacted the site, waiting for them to solve it.
Whiteboard: [country-cn] [serversniff] [tier1] [contactready] → [country-cn] [serversniff] [tier1] [sitewait]
Hi YiLiu, Just wondering have you have any response from Baidu? Thanks!
Hi josh, our BD team have contact baidu but they don't plan to fix in short time. because there are no firefox os device in China mainland yet so the user impact is very limited. I think this should not be a blocker for woodduck.
Hi Gary, Can you help to add Baidu.com to https://hg.mozilla.org/mozilla-central/file/tip/b2g/app/ua-update.json.in? Thanks!
Hi Josh, Please do not push things like this. It's not the way we are trying to solve things. I proposed already to help you with UA override, asking someone else will not make things faster. Thanks for your understanding. First we need to test which UA will work. If the Comment #1 is still valid or not. Then read carefully the comment #9 by Peipei. I will test again on next Monday, but according to comment #1, we will not achieve a solution with *any* UA override. There is no point doing a UA override if we send the user to a broken mobile Web site. ^_^ The question before asking UA override is to discover if there is a UA override triggering 1. The right redirection 2. Without breaking the site. So I will do testing on Monday and I will report it my findings and we can decide *together* what we do.
Flags: needinfo?(gchen) → needinfo?(jocheng)
Hi Karl, Thank you very much for the clarify. I thought overriding will return page like "Chrome Android". The current "Firefox Android receives a simplified Mobile Content" seems just a WAP page. Peipei already updated me that she is now working with Baidu to solve the issue. Let's hope they can solve it soon. We are really looking forward to have your session about UA at Whistler. Thank you very very much for the help!
Hi Josh, We got feedback from baidu today. It will took at least two weeks to fix this problem. Considering the amount of ffos device is very limited in China, they won't put this as high priority. We will try to look for other contact to see if we can push further.
Firefox Android receives a simplified version compared to Chrome on Android. Let's track this on https://webcompat.com/issues/3149
Closing as fixed.
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Priority: P2 → P1
Resolution: --- → FIXED
Product: Tech Evangelism → Web Compatibility
You need to log in before you can comment on or make changes to this bug.