I'm a teapot
nytimes.com
nytimes.com
$ curl -I http://www.nytimes.com/418
HTTP/1.1 200 OK
Server: Sun-ONE-Web-Server/6.1
Date: Wed, 25 Jan 2012 21:28:58 GMT
Content-length: 17
Content-type: text/plain
Set-cookie: RMID=2dab5fc96b364f20741aba0c; expires=Thursday, 24-Jan-2013 21:28:58 GMT; path=/; domain=.nytimes.com
Last-modified: Fri, 29 Apr 2011 19:40:57 GMT
Etag: "11-4dbb1449"
Accept-ranges: bytesVarnish does the same thing, which is why you can't get a 418 code out of httpstat.us/418, which is on heroku. Same goes for that cat-based one that came up the other week, which is also on heroku.
[1]http://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_P...
The idea was that I might have domains configured on my DNS which resolved to the same machine. And if you connect to that machine on port 80, no matter what domain, you will get the HTTP server.
The problem is, the DNS might recognize domains which the HTTP server is not listening for, e.g. "mail.drostie.org" or some such. When you visit those in a web browser, the server can't do what it's supposed to do -- pretend it's not listening on port 80 -- because it already received the HELO and the GET.
It's also clearly a client error, so the error code should be in the 4xx range. But just go down the list: it's not a syntax error (400), it wasn't unauthorized (401), payment isn't required (402), and the server technically didn't even understand the request, so it's not 'I understand but I refuse to fulfill' (which is 403). It's not that some file was not found (404) or that GET is not allowed (405) or that we couldn't fit the Accept HTTP header (406).
The real problem is that you asked mail.drostie.org to do something other than handle mail. None of the 4xx status codes really fits, and the one that comes closest is... 418. You asked me to brew coffee, but I'm a teapot.
> curl -i 'httpstat.us/418'
HTTP/1.1 418 Unknown Error
Server: nginx
Date: Wed, 25 Jan 2012 23:58:13 GMT
Content-Type: text/plain
Connection: keep-alive
Access-Control-Allow-Origin: *
Content-Length: 16
X-Varnish: 1346742606
Age: 0
Via: 1.1 varnish
418 I'm a Teapot
although it shows as 'Unknown Error' instead of 'I'm a Teapot' HTTP/1.1 418 I'm a teapot
Date: Wed, 25 Jan 2012 23:57:22 GMT
Server: Apache
X-Webapp: cbeebieshome
X-Generated: Wed, 25 Jan 2012 23:57:22 +0000
Cache-Control: max-age=60
Content-Type: text/html; charset=utf-8
Content-Length: 20820
X-Cache-Action: PASS (status)
X-Cache-Age: 0The page claims that http://134.219.188.123/ is the device in the picture. Since we may be about to hammer it:
jerf@jerfhom ~ $ curl -i http://134.219.188.123/
HTTP/1.0 418 I am a Teapot
Server: BaseHTTP/0.3 Python/2.4.4
Date: Thu, 26 Jan 2012 01:38:15 GMT
Content-Type: text/html
Connection: close
<head>
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code 418.
<p>Message: I am a Teapot.
<p>Error code explanation: 418 = ???.
</body>Perhaps the next implementation should use Raspberry Pi instead of a laptop.
tillberg:~ dan$ curl -i -X BREW http://134.219.188.123/
HTTP/1.0 501 Unsupported method ('BREW')
Server: BaseHTTP/0.3 Python/2.4.4
Date: Thu, 26 Jan 2012 05:02:36 GMT
Content-Type: text/html
Connection: close
<head>
<title>Error response</title>
</head>
<body>
<h1>Error response</h1>
<p>Error code 501.
<p>Message: Unsupported method ('BREW').
<p>Error code explanation: 501 = Server does not support this operation.
</body>http://en.wikipedia.org/wiki/Hyper_Text_Coffee_Pot_Control_P...