specs icon indicating copy to clipboard operation
specs copied to clipboard

Gateway should respond with 502 Bad Gateway when unable to resolve a node

Open iand opened this issue 3 years ago • 0 comments

The definition of 502 Bad Gateway is:

indicates that the server, while acting as a gateway or proxy, received an invalid response from the upstream server.

This fits the situation where namesys is unable to resolve a node. In these cases it returns ErrResolveFailed or ErrResolveRecursion.

Currently the gateway responds with 400 Bad Request which indicates that the client made a mistake and should not re-issue the request in the same form. However resolution errors may be transitory and the client should be permitted to retry the request. To indicate this we we should detect resolution failures and respond with 502. Potentially we can also include an advisory Retry-After header.

iand avatar Jul 21 '22 20:07 iand