Status Codes Question (Forbidden/Internal Server Error)

Sean Conner sean at conman.org
Thu Jul 16 10:24:47 BST 2020


It was thus said that the Great Caranatar once stated:
> Hi folks, 

  Howdy.

> I have a pretty simple question that I wasn't able to find anywhere on the
> mailing list or elsewhere:
> 
> Are there equivalents to the forbidden and internal server error status
> codes in HTTP? Alternatively, what extant status codes would y'all
> recommend using to indicate those errors?

  It's there, but probably under a different subject line.  There's this
message I sent last year:

	https://lists.orbitalfox.eu/archives/gemini/2019/000107.html

It's for running web-based CGI scripts under Gemini [1].  Here's the table I
presented:

        HTTP status     Gemini status
        ---------       --------
        200-299         20
        301             31
        300-399         30
        403             60
        404             51
        405             59
        400-499         50
        500-599         40
        000-999         50

> It's mostly for debugging sake, but I found myself wanting a way to say
> "oops! File permissions are screwed up!" or "oops! I wrote some bad code
> and there's an unexpected error somewhere". Right now I use 51 for
> permissions and 59 for a catch all error, but I feel like they're
> semantically different enough that it irks me to use them.

  What I do is use the most generic status code I can, and log (via syslog()
but use whatever mechanism works for you) the actual error to prevent
information from leaking out to a Gemini client.

  -spc

[1]	GLV-1.12556 [2] can run web-based SCGI/CGI scripts, and I had to set
	up a mapping of status values.

[2]	https://github.com/spc476/GLV-1.12556


More information about the Gemini mailing list