<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Michael Wolbert's Blog &#187; mobile</title>
	<atom:link href="http://michaelwolbert.nl/blog/tag/mobile/feed/" rel="self" type="application/rss+xml" />
	<link>http://michaelwolbert.nl/blog</link>
	<description></description>
	<lastBuildDate>Thu, 06 May 2010 12:44:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Hijacking HTTP headers starring Vodafone</title>
		<link>http://michaelwolbert.nl/blog/2009/09/hijacking-http-headers-starring-vodafone/</link>
		<comments>http://michaelwolbert.nl/blog/2009/09/hijacking-http-headers-starring-vodafone/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 08:35:48 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[User Experience]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[HTTP]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Smarty]]></category>
		<category><![CDATA[Vodafone]]></category>
		<category><![CDATA[WURFL]]></category>

		<guid isPermaLink="false">http://michaelwolbert.nl/blog/?p=204</guid>
		<description><![CDATA[Currently I&#8217;m working on a mobile website and I&#8217;m in the midst of some pain-in-the-arse compatibility issues on page rendering on multiple handsets. I ran across WURFL (Wireless Universal Resource FiLe) , a project which can help you detect a device and to retrieve its device specific properties. WURFL models the properties of wireless/mobile devices [...]]]></description>
			<content:encoded><![CDATA[<p>Currently I&#8217;m working on a mobile website and I&#8217;m in the midst of some pain-in-the-arse compatibility issues on page rendering on multiple handsets. I ran across <a href="http://wurfl.sourceforge.net/" target="_self">WURFL</a> (<strong>W</strong>ireless <strong>U</strong>niversal <strong>R</strong>esource <strong>F</strong>i<strong>L</strong>e) , a project which can help you detect a device and to retrieve its device specific properties. WURFL models the properties of wireless/mobile devices in a 13mb XML file.</p>
<p>Next to that there are a lot of APIs (<a href="http://www.tera-wurfl.com/" target="_self">TERA-WURFL PHP</a>, <a href="http://www.madagasgar.com/wurfl/">WURFL-PHP</a>, WURFL-Java, WURFL-.NET and WURFL-Perl). I&#8217;m using the TERA-WURFL PHP API since I&#8217;m also fond of the <a href="http://smarty.net" target="_self">Smarty template engine</a>. :-)</p>
<p><strong>How it works<br />
<span style="font-weight: normal;">The WURFL-PHP API uses a mysql instance to store device specific properties. </span></strong>A caching mechanisms works on top of the mysql instance to enable lightning fast queries on the database.</p>
<p>By querying the device table (11,000+ rows) using $_SERVER['HTTP_USER_AGENT'], we can now retrieve our device screen width capability:</p>
<pre>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;"><span class="re0">$width</span> = <span class="re0">$wurfl</span>-&amp;gt;getCapa<span class="br0">&#40;</span><span class="st0">'resolution_width'</span><span class="br0">&#41;</span>; <span class="co1">// get width capability</span></div>
</div>
</pre>
<p>All capabilities can be found at WURFL&#8217;s documentation: <a href="http://wurfl.sourceforge.net/help_doc.php">http://wurfl.sourceforge.net/help_doc.php</a>.</p>
<p><strong>Back to Vodafone:<br />
<span style="font-weight: normal;">Ok, so why does Vodafone suck?</span></strong></p>
<p><strong><span style="font-weight: normal;">Well, it is all about Vodafone&#8217;s reformatting proxy. A what? Yeah, a reformatting proxy. Vodafone uses reformatting proxies to reformat a page to display only the content of interest (ie. article text, article thumbnail, <strong>no</strong> layout). This comes in handy when a website doesn&#8217;t have a mobile design; think about reading <a href="http://slashdot.org/" target="_self">Slashdot</a> without a reformat. However, many websites have a mobile specific website nowadays, which leads to better user experience, since reformatted pages are mostly completely stripped down. The big problem in this case is that Vodafone&#8217;s reformatting proxy changes crucial HTTP headers..</span></strong></p>
<ul>
<li>A normal request from a mobile phone:
<pre>HTTP_USER_AGENT =&gt; Nokia6288/2.0 (05.92) Profile/MIDP-2.0 Configuration/CLDC-1.1
HTTP_X_WAP_PROFILE =&gt; "http://nds1.nds.nokia.com/uaprof/N6288r100.xml"</pre>
</li>
<li>Vodaphone&#8217;s reformatting proxy&#8217;s request:
<pre>HTTP_USER_AGENT =&gt; = Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.7) Gecko/
Firefox/1.5.0.7 MG (Novarra-Vision/6.1)
HTTP_X_DEVICE_USER_AGENT =&gt; Nokia6288/2.0 (05.94) Profile/MIDP-2.0 Configuration/CLDC-1.1</pre>
</li>
</ul>
<p>The reformat proxy changed the HTTP_USER_AGENT header to a desktop browser version [sigh]. HTTP_X_DEVICE_USER_AGENT is a non-standard HTTP header. Hijacking HTTP headers is great sport, way to go Vodafone! Is this just as bad as <a href="http://michaelwolbert.nl/blog/2008/09/free-magenta-from-these-evil-minds-at-t-mobile/" target="_self">claiming a color</a>?</p>
<p><strong>References:</strong></p>
<ul>
<li><a href="http://wurfl.sourceforge.net/vodafonerant/">http://wurfl.sourceforge.net/</a></li>
<li><a href="http://wurfl.sourceforge.net/vodafonerant/">http://wurfl.sourceforge.net/vodafonerant/</a></li>
<li><a href="http://www.betavine.net/bvportal/forums/index.html?threadId=207&amp;postPage=6">http://www.betavine.net/bvportal/forums/index.html?threadId=207&amp;postPage=6</a></li>
<li><a href="http://wapple.net/press-releases/33/vodafone-misses-the-point-of-the-mobile-internet.htm">http://wapple.net/press-releases/33/vodafone-misses-the-point-of-the-mobile-internet.htm</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://michaelwolbert.nl/blog/2009/09/hijacking-http-headers-starring-vodafone/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

