boazsegev / iodine

iodine - HTTP / WebSockets Server for Ruby with Pub/Sub support
MIT License
912 stars 51 forks source link

support HTTP code 418 #145

Closed akostadinov closed 1 year ago

akostadinov commented 1 year ago

418 I'm a teapot was a result of RFC2324 which was an April 1 RFC. See rfc9110 for more detailed information.

It is still very useful to allow for creating easter eggs and generally make life more fun. And as we all know, boring is worse than death.

This is only my personal opinion, but anyway, it is the only correct opinion.

My specific use case is my websocket echo server that does not process HTTP requests and should warn users making HTTP requests that this is not the intended purpose of the service.

Presently it uses 405 which is probably reasonable but boring. See https://github.com/akostadinov/websocket-echo-io/blob/0.1.0/lib/websocket/echo/io/server.rb#L26

/fixes #144

boazsegev commented 1 year ago

🤣🤣🤣

Oh, that's the best reasoning ever, I loved it! 🤣

Okay, I'll merge it now 👍🏻

Cheers 🎉

boazsegev commented 1 year ago

FYI: also patched facil.io's next version to support Teapots :)

https://github.com/facil-io/cstl/blob/02b2b9d6e030ed972852d83f5e5d2e6f444be6f3/fio-stl/431%20http%20handle.h#L2777