[spec] Undefined status codes

nervuri nervuri at disroot.org
Tue Oct 26 10:20:09 BST 2021
I am writing a REST API for Gemini and need to have more than one status
code coupled with a response body (to parallel the 409 response in
Convergence's Notary protocol [1]).  Only 2x status codes allow for
response bodies, and the only defined 2x status code is 20.  No problem,
I thought.  The second digit is optional, so gemini clients and
libraries should accept any 2x status code and treat unknown ones as 20.
Right?  Well, not in practice.  The clients I tested treat the request
as failed if the status code begins with 2 but is anything other then
20.

Let's clarify what the behavior of clients ought to be.  I think this
makes the most sense:

* if the response contains an undefined status code that begins with
 1-6, the client must handle it as though the second digit were 0;
* if the response contains a status code that begins with anything other
 than 1-6, the client must consider it invalid (of course).

I also opened an issue on Gitlab for this, see [2].

[1] https://github.com/moxie0/Convergence/wiki/Notary-Protocol#409
[2] https://gitlab.com/gemini-specification/protocol/-/issues/43


Archive home | About this archive