I’m A Teapot – HTTP status code 418
httpstatuses.com
httpstatuses.com
>Freshly boiling water is poured into the pot
vs preparing green tea [2]
>Steeping temperatures range from 61 °C (142 °F) to 87 °C (189 °F) and steeping times from 30 seconds to three minutes.
Of course he doesn't like tea if he brews green tea with too hot water.
[1] https://en.wikipedia.org/wiki/ISO_3103 [2] https://en.wikipedia.org/wiki/Green_tea
It is a good point.
Many teas go bad when put in too hot water, green tea comes to mind, but I'm sure there are others as well. These kinds of teas should never be in water that is anywhere near boiling.
There was lengthy discourse between the two men on which of them was more honored to be in the company of the other, followed by exhaustive discussion of the relative merits of the different teas offered by the proprietors, whether the leaves were best picked in early or late April, whether the brewing water should be violently boiling as the pathetic gwailos always did it, or limited to eighty degrees Celsius.
> If a large pot is used, it should hold a maximum of 310 ml (±8 ml) and must weigh 200 g (±10 g).
looks at cast iron teapot
what?
> Freshly boiling water is poured into the pot to within 4–6 mm of the brim. Allow 20 seconds for water to cool.
looks at bag of loose-leaf green tea
the?
> Brewing time is six minutes.
looks at green tea again
fuck?
> 2 grams of tea (measured to ±2% accuracy) per 100 ml boiling water is placed into the pot.
looks at gaiwan
This is obviously a colonial document written by limey tea-monsters.
I'll take limey but colonial you can stuff up your arse 8)
As noted elsewhere, there is no way to meaningfully compare teas that require lower temperatures or longer seeping time with this procedure.
Or more generally shorter seeping time, I've never seen a tea which wanted 6mn seep time, and most somewhat fragile tea want way less (with the possible exclusion of summing the consecutive infusions of an oolong, I guess you do get into the 6mn range total at the end of the session).
(I guess there is still the option of cold brewed tea though)
Which is exactly what you're going to do if you steep white or green tea in boiling water for 6mn. You might as well throw the tea into a half-full kitchen bin, wait 6 weeks and lick the bin-juice.
Large holds only just over 1 cup of water? This seems tiny.
> 2 grams of tea (measured to ±2% accuracy) per 100 ml boiling water is placed into the pot.
This means 20 grams per liter. That's ridiculously strong tea. 4-8 grams per liter is much more reasonable.
> Freshly boiling water is poured into the pot to within 4–6 mm of the brim. Allow 20 seconds for water to cool.
This is after putting the tea in the pot. But for green tea, you should let the water cool (in the pot or the kettle) before adding it to the tea.
> Brewing time is six minutes.
Again, some teas are better with a different brewing time.
Didn't take long to figure out that the sites had actually been online the whole time for everyone else; they were only inaccessible from my local network. At that point, I contacted my host, and they explained that the WordPress component of the Shortcuts app was, for some reason, bombarding the server with a whole lot of requests for files that didn’t exist. The server thought it was under attack and blocked my whole network. Then it got interesting: the guy said that the server was throwing 418s.
I thought he might be mistaken at first. I actually recognized 418, since I've known about the teapot thing for a little while. I asked the guy if it was really the case that the server was blocking my network because it thought my phone was making too many demands for coffee it wasn't capable of producing, and he said that, well, other than the coffee bit, DreamHost really does use 418 for that situation: https://help.dreamhost.com/hc/en-us/articles/215947927-How-d...
That is the only time I've encountered 418 in the wild. That decision seems to be pretty consistent with DreamHost's sense of humor.
(They did, as usual, manage to fix my problem.)
Basically, there was a machine-readable way to tell you to go away. But instead they told your user agent that they were unable to brew coffee because they are a teapot. What a waste of everyone's time.
I love Shortcuts—it's a great automation tool with some good ideas—but, as is the case with many Apple things, it prioritizes minimalism over functionality. Seems like an odd tradeoff to me, since I think the only people who even know Shortcuts is on their device are people like me who would vastly prefer full-featured complexity—and better documentation—to the smooth, almost toy-like UX.
Much to my astonishment/amusement, it did.
[0] https://github.com/freebsd/freebsd/blob/master/sys/kern/kern...
In traditional BSD kernels, there is a portable layer and a machine dependent layer. The cpu MD layer for context switching was called cpu_switch(), usually written in assembler. It saved the current state and switched to another. When you regained control of the cpu, you returned from cpu_switch(). There was always somewhere to switch to.
When we added multiple threads per process (part of the KSE effort back in the day), a new low level construct was added - cpu_throw(). You switched somewhere else and threw away your context, didn't put the old thread in the run queue, and never returned. We used this for quickly disposing of threads.
This was all fine, thread implementations, process/thread schedulers, etc came and went.
Somewhere along the way, somebody reused the NetBSD MD/asm layer for one of the powerpc architectures. Of course, NetBSD didn't have cpu_throw(). It was #defined to cpu_switch() because it was close enough and worked.
Until somebody tried to use threading on this powerpc architecture. The fake cpu_throw() didn't prevent a return and the system got far enough to reach the upper machine independent layers and hit the panic.
This caused some amusement. Particularly as somebody had previously suggested that the panic was unnecessary as it cannot happen but I wanted to keep it anyway.
Surely "just happened" is the default state of all impossible, cannot happen scenarios?
― Terry Pratchett, Mort
I know it’s in jest but I absolutely hate to encounter this kind of thing in the wild. It’s a huge anti pattern and tax you put on other people who have to troubleshoot “impossible” scenarios.
Sure the solution is still one search away, but…
These days, getting a phrase you can Google effectively is golden. I don't care if I'm pasting "Ream my holes with a bottle brush, Sir Clyde, for I am going to be late for tea!" as long as it gets me the information I need to fix the problem faster.
That said, maybe something in Latin would be more couth:
https://multicians.org/hodie-natus-est.html
> HODIE NATUS EST RADICI FRATER
Which means "today unto the Root a brother is born."
For what it stands for, that comes from a story told by a friend in college whose best friend had done a summer working at a navy shipyard with several salty old mechanics.
Their speech was very liberally sprinkled with the word "fuck".
One day, they got an engine in for repair that was in particularly bad shape. After accessing it, one of the mechanics gave his verdict, and at the same time set a new record for the density of "fuck" in their speech.
His verdict: "This fucking fucker's fucked".
https://puzzling.stackexchange.com/questions/83152/a-strange...
Sigh, conference room naming systems! I worked somewhere many years ago where the conference rooms were named after birds of prey: falcon, kestrel, eagle, etc. The smoking room (back in the day) was informally named 'puffin'.
Almost as much fun as server naming conventions.
https://www.iana.org/assignments/http-status-codes/http-stat...
This code has never been officially registered, especially not by that April Fools’ RFC. A number of HTTP implementations added it to their lists of codes anyway; there was a concern that it might create a conflict with if an actual meaning is assigned by the HTTP specification. One of the authors of the specification went around asking libraries to remove the code for this reason. Web developers, like the mature people they are, bullied him into abandoning it.
By the way, if one actually wanted to control coffee pots over HTTP, 400 Bad Request would have been entirely sufficient for this situation. This code has been superfluous from the start. Ironically, it became the very thing it was meant to satirise.
The whole idea of status codes is that if you encounter one you don’t know about, you can treat it as a member of that family, so any unknown 4xx will be treated the same as a 400. Most of the 400 series is about clarifying what was wrong with the request. 400 just says something’s wrong about the request, but not what. 405 says it’s the method. 406 says it can’t satisfy the provided Accept header. 411 says it wants a Content-Length header. 418 says it’s that you tried to brew coffee in a teapot.
That you tried to do something so absurdly inappropriate that there isn't even a proper technical way to explain why it was wrong and why it could not work? Like, the server could not even begin to understand what you tried to accomplish with that request.
The "Blank Stare" response code. Or maybe the "Stunned Stare And Slowly Backing Away" response code.
Something at the other end:
https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
> 420 Enhance Your Calm (Twitter)
>> Returned by version 1 of the Twitter Search and Trends API when the client is being rate limited; versions 1.1 and later use the 429 Too Many Requests response code instead.[74] The phrase "Enhance your calm" comes from the 1993 movie Demolition Man, and its association with this number is likely a reference to cannabis.
Visually:
I read 50x as "something not your fault" went wrong.
In fact RFC 6585 added "429 Too Many Requests" specifically for rate-limiting scenarios.
413 (payload too large), 414 (URI too long) or 431 (header fields too large) are likewise things which may technically be valid according to the HTTP spec in general, but which the server rejects.
Wow, guess they better not do that then. In the meantime, it sounds like their spec is wrong.
So there is a status code everyone knows is used. The people running the official list know it is used. Now you have a guy running around telling people that they should stop using it because why exactly? Are the people running the list suddenly going to forget that it is in use? Are they going to ignore the issues caused by introducing a status code where the value is already widely misused by existing systems? Are they that intentionally malicious to cause a problem out of spite?
> Web developers, like the mature people they are, bullied him into abandoning it.
As opposed to the guy on a power trip trying to stomp on everyones fun? Grownup people are allowed to have fun, aren't they?
with my favorite: http://httpstatusrappers.com/200.html
There’s an official registry of status codes: https://www.iana.org/assignments/http-status-codes/http-stat....
HTTP libraries normally use this as their canonical source of status codes that they should have constants (or whatever) defined for.
But 418 I'm a teapot is not in that registry. It’s not clear to me why it wasn’t put in when the registry was established, but it seems most likely that someone made an executive judgement against pointless fun.
To my knowledge, it’s the only status code from an RFC that has not made it into the registry. So many HTTP libraries, perhaps most, have this one exception, an extra status code not from the registry.
In 2017, the httpbis working group chairman Mark Nottingham (mnot) sought to get 418 removed from libraries everywhere (since it wasn’t registered and wasn’t serious); this met with popular resistance (people like their fun) and so he changed direction and sought to have 418 registered properly instead, with https://datatracker.ietf.org/doc/draft-nottingham-thanks-lar.... But that draft was allowed to expire and I’m not sure why.
Because the current status quo is good enough.
Like in theory, sure, removing 418 makes sense for cleanup purposes. Or barring that, officially registering it.
In practice, it completely does not matter whatsoever. Keeping pointless things out of the registry is fine. And they're not stupid, they're never going to assign 418 to something else, so having 418 in libraries is not going to be an issue. At the end of the day, the current situation is ideal.
https://www.ietf.org/id/draft-ietf-httpbis-semantics-10.html...
Note the description doesn’t say ‘I’m A Teapot’.
I learned about it when I received a copy of BRL-CAD from the Army Research Lab in the mid-90s and it had a teapot, which I thought was quite odd for an application designed for ballistic research.
https://en.wikipedia.org/wiki/Boiling_vessel
> A boiling vessel is a water heating system fitted to British armoured fighting vehicles that permits the crew to heat water and cook food by drawing power from the vehicle electrical supply.[1] It is often referred to by crewmembers (not entirely in jest) as the most important piece of equipment in a British armoured vehicle
I have nginx reply with a 418 page to bad bots requests. Funny easter egg. As a bonus, that makes nginx avoid checking the filesystem for inexistent files, and makes filtering logs easier.
Nginx config snippet:
# Nothing to hack around here, I’m just a teapot:
location ~* \.(?:php|aspx?|jsp|dll|sql|bak)$ {
return 418;
}
error_page 418 /418.html;
Example: https://FreeSolitaire.win/wp-login.phpI wonder if it actually saves much time. Probably not.
It made for an interesting troubleshooting session, because at the time, not all browsers would display a meaningful result. Some would return a blank screen - which is easy to find. But not as easy when it was a single call among many others in the page...
For example, status 422 is used for syntactically correct, but semantically invalid request bodies. Augment your graphql library or application code where appropriate.
That way, you reap the benefits of interoperability. Being in compliance makes you a good Internet citizen in the eyes of your peers.
Edit: I misremembered, it was a coffee pot. Bloody barbarians!
From RFC 2324, “ [CBIO] "The Trojan Room Coffee Pot, a (non-technical) biography", Q. Stafford-Fraser, University of Cambridge Computer Lab, <http://www.cl.cam.ac.uk/coffee/qsf/coffee.html>
The argument went that a kettle is not a tea pot since before adding a tea bag you can use the hot water for anything, including instant coffee. Someone added a tea bag dunker to the kettle. People started complaining about taking away choice by forcing everyone to use the kettle as a tea pot, so I added a empty tea bag as one of the selections. The argument then went that since it can load empty tea bags it is not a permanent tea pot even though it is mostly a tea pot so it shouldn't include 418 as per RFC 7168.
The last I'd heard of it, they had added peristaltic pumps that can be accessed individually, so if you sent an HTCPCP request to the tea designated pump for coffee it would return 418, but if you sent it to the beverage server it would route your order to the correct pump.
Yes it is.
> it’s not clever
Hmm. Don't really care. Ever try to debug clever code? Exactly.
> Please don’t do it
Dev goals: I'm absolutely going to find something I can sneak this into.
> Find another way to be clever and funny.
Yes, but after I'm done releasing these precious 418s.
In fact, you should go brew yourself a cup. You're always kind of a grump til you get a cuppa'.