RFC 2616 section 6.1.1 specifies that "HTTP status codes are extensible":
HTTP status codes are extensible. HTTP applications are not required to understand the meaning of all registered status codes, though such understanding is obviously desirable.
A common example is Twitter's 420 Enhance Your Calm.
I want to respond with custom codes in a Rack application. I'm able to use custom codes in a super-straightforward way:
app = proc do |env|
['299', {}, ['Hey there custom status codes!']]
end
run app
The server responds correctly with:
HTTP/1.1 299
Connection: Keep-Alive
...
What I want to do though is define custom codes and associated custom messages. I've searched Rack documentation and googled for a while but didn't come to any conclusive answer.