<?xml version="1.0"?>
<rss version="2.0">
<channel>
  <title>simplericity - http tag</title>
  <link>http://simplericity.com/tags/http/</link>
  <description>Reducing software entropy</description>
  <language>en</language>
  <copyright>Eirik Bjørsnøs</copyright>
  <lastBuildDate>Fri, 02 Jan 2009 11:02:56 GMT</lastBuildDate>
  <generator>Pebble (http://pebble.sourceforge.net)</generator>
  <docs>http://backend.userland.com/rss</docs>
  
  
  <item>
    <title>The extra dot in dot-com</title>
    <link>http://simplericity.com/2007/10/29/1193665479084.html</link>
    
      
        <description>
          &lt;p&gt;Sun no longer claims they &amp;quot;put the dot in dot-com&amp;quot;, but did you know there&#039;s actually more than one dot in dot-com?&lt;/p&gt;
&lt;p&gt;According to &lt;a href=&#034;http://www.ietf.org/rfc/rfc1034.txt&#034;&gt;RFC1034&lt;/a&gt; &amp;quot;www.example.com&amp;quot; is a &lt;em&gt;relative&lt;/em&gt; domain name. The complete domain name (also called &lt;em&gt;absolute&lt;/em&gt;) is &amp;quot;www.example.com.&amp;quot; (Notice the trailing &amp;quot;.&amp;quot;)&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;Reading this RFC one should think that adding a trailing dot to a domain name should have no effect. All you&#039;re doing is to be explicit by using the absolute representation of the domain right?&lt;/p&gt;
&lt;p&gt;Not quite so. It doesn&#039;t seem like web server vendors and administrators have read this RFC and neither have web browser vendors. This becomes a problem if you&#039;re using name based virtual hosting on your web server. When the server gets a request for &amp;quot;www.example.com.&amp;quot; it won&#039;t have a clue that the user is actually looking for the content at &amp;quot;www.example.com&amp;quot;.&lt;/p&gt;
&lt;p&gt;So I did a little survey on the web servers I use. The &lt;a href=&#034;http://httpd.apache.org&#034;&gt;Apache HTTP Server&lt;/a&gt; handles the trailing dot perfectly. &lt;a href=&#034;http://tomcat.apache.org&#034;&gt;Tomcat&lt;/a&gt; doesn&#039;t understand it and serves content from the default host instead. You can mediate this by always adding an &lt;alias&gt;alias with the trailing dot, but that&#039;s a hack and it&#039;s something the server should handle by itself.&lt;/alias&gt;&lt;/p&gt;
&lt;p&gt;I was a little disappointed to find that &lt;a href=&#034;http://jetty.mortbay.org&#034;&gt;Jetty&lt;/a&gt; (my favorite web server) failed the trailing dot test. But then I remembered how nice the Jetty developers are so a couple of weeks ago I decided to fix the problem and&amp;nbsp; &lt;a href=&#034;http://jira.codehaus.org/browse/JETTY-438&#034;&gt;submit a patch&lt;/a&gt; for it. Today Greg applied it. From the next release onwards, Jetty will normalize host names before comparing them. Try reporting something like that to IBM or BEA and you&#039;ll find out why Jetty rocks!&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;Now, just for the fun of it, let&#039;s take a look at how some big sites handle requests with trailing dots:&lt;/p&gt;
&lt;h2&gt;Microsoft: Bad request&lt;/h2&gt;
&lt;p&gt;Microsoft solves the problem the easy way. Just blame it on the user:&lt;/p&gt;
&lt;img alt=&#034;&#034; src=&#034;http://simplericity.com/images/trailingdot/microsoft.png&#034; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;MSN: Page not found&lt;/h2&gt;
&lt;p&gt;MSN is a little more polite, they even say they&#039;re sorry:&lt;/p&gt;
&lt;img alt=&#034;&#034; src=&#034;http://simplericity.com/images/trailingdot/msn.png&#034; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Myspace: Redirect to google&lt;/h2&gt;
&lt;p&gt;I knew Myspace and Google made an advertising deal, but this is just weird:&lt;/p&gt;
&lt;img alt=&#034;&#034; src=&#034;http://simplericity.com/images/trailingdot/myspace.png&#034; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Facebook: Redirect to www.facebook.facebook.com&lt;/h2&gt;
&lt;p&gt;Facebook is getting so big they seem to have started a facebook inside the facebook, but there&#039;s no response there:&lt;/p&gt;
&amp;nbsp;&lt;img alt=&#034;&#034; src=&#034;http://simplericity.com/images/trailingdot/facebook.png&#034; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;NSA: Trust no one, say nothing&lt;/h2&gt;
&lt;p&gt;One can say a lot about the NSA, but don&#039;t give them a trailing dot because they will refuse to talk to you. Period.  &lt;/p&gt;
&lt;img src=&#034;http://simplericity.com/images/trailingdot/nsa.png&#034; alt=&#034;&#034; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Sun: Page not found&lt;/h2&gt;
&lt;p&gt;Sun may once have &amp;quot;put the dot in dot-com&amp;quot;, but that&#039;s no longer the case. They&#039;re more sorry than MSN though. Sorry with an exclamation point. And what makes them think I own documents at sun.com?&lt;br /&gt;
&lt;/p&gt;
&lt;img src=&#034;http://simplericity.com/images/trailingdot/sun.png&#034; alt=&#034;&#034; /&gt;
        </description>
      
      
    
    
    
    <category>Java</category>
    
    <comments>http://simplericity.com/2007/10/29/1193665479084.html#comments</comments>
    <guid isPermaLink="true">http://simplericity.com/2007/10/29/1193665479084.html</guid>
    <pubDate>Mon, 29 Oct 2007 13:44:39 GMT</pubDate>
  </item>
  
  </channel>
</rss>
