Best practices in Gemini servers

Michael Lazar lazar.michael22 at gmail.com
Wed Sep 11 03:47:47 BST 2019


On Tue, Sep 10, 2019 at 3:35 PM Sean Conner <sean at conman.org> wrote:
> It was thus said that the Great Jason McBrayer once stated:
> > Sean Conner <sean at conman.org> writes:
> >
> > >   I'm currently returning a "Bad Request" for this, if the protocol, host
> > > and port don't match what is currently configured on my server.  The other
> > > possible status is "Proxy Request Refused".  My server doesn't do proxy
> > > requests.  What should the proper status code be?  Is "Bad Request" fine
> > > here?
> >
> > In my opinion, the Most Correct response to return would be "Proxy
> > Request Refused". If they had made the same request to a the right
> > server or if this server had been configured differently, it would have
> > succeeded, so the request isn't malformed or anything. But Bad Request
> > is probably the next-best response; Not Found would also make a kind of
> > sense.
>
>   Hmmm ... if my sever did any proxying, then yes, "Proxy Request Refused"
> would make sense.  "Not found" doesn't, because the resource could be found,
> not just through me.
>
>   I suppose I could serve up "Proxy Request Refused" ...

On Tue, Sep 10, 2019 at 3:35 PM Sean Conner <sean at conman.org> wrote:
> It was thus said that the Great Jason McBrayer once stated:
> > Sean Conner <sean at conman.org> writes:
> >
> > >   I'm currently returning a "Bad Request" for this, if the protocol, host
> > > and port don't match what is currently configured on my server.  The other
> > > possible status is "Proxy Request Refused".  My server doesn't do proxy
> > > requests.  What should the proper status code be?  Is "Bad Request" fine
> > > here?
> >
> > In my opinion, the Most Correct response to return would be "Proxy
> > Request Refused". If they had made the same request to a the right
> > server or if this server had been configured differently, it would have
> > succeeded, so the request isn't malformed or anything. But Bad Request
> > is probably the next-best response; Not Found would also make a kind of
> > sense.
>
>   Hmmm ... if my sever did any proxying, then yes, "Proxy Request Refused"
> would make sense.  "Not found" doesn't, because the resource could be found,
> not just through me.
>
>   I suppose I could serve up "Proxy Request Refused" ...

My server returns NOT FOUND only because it made the implementation simpler &
cleaner to use the same response code for all unmatched URLs. Either the server
can locate the resource specified by the given URL, or it can't. It feels
arbitrary to make a distinction on whether it's the path component or the
hostname or the scheme that doesn't match. Perhaps I should be using PERMANENT
FAILURE instead since it's the more general 5x error code.


More information about the Gemini mailing list