jenkins-bot has submitted this change and it was merged.

Change subject: Log Accept headers in conjunction with User-agent
......................................................................


Log Accept headers in conjunction with User-agent

I need this to figure out what to do with X-WAP detection.

Change-Id: I51d4420ac8a1e21a5ed29fefc07941cf7e4180af
---
M includes/MobileFrontend.body.php
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  awjrichards: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php
index 0251f87..0ce5e44 100644
--- a/includes/MobileFrontend.body.php
+++ b/includes/MobileFrontend.body.php
@@ -7,6 +7,13 @@
         * @return string
         */
        public static function DOMParse( OutputPage $out ) {
+               // Debug logging: we need a list of Accept: headers to make 
some WAP detection decisions
+               // Done here to make sure that only mobile view requests are 
logged
+               if ( mt_rand( 0, 10000 ) == 0 ) {
+                       $req = $out->getRequest();
+                       wfDebugLog( 'mobile', "User-agent: '{$req->getHeader( 
'User-agent' )}', Accept: '{$req->getHeader( 'Accept' )}'" );
+               }
+
                wfProfileIn( __METHOD__ );
 
                $html = $out->getHTML();

-- 
To view, visit https://gerrit.wikimedia.org/r/80026
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I51d4420ac8a1e21a5ed29fefc07941cf7e4180af
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: awjrichards <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to