Deno: [bug]: allow custom http codes

Created on 19 May 2020  路  3Comments  路  Source: denoland/deno

e.g. returning status 555 gives this:

error: Uncaught InvalidData: Bad status code
    throw new Deno.errors.InvalidData("Bad status code");
bug std

All 3 comments

not compliant with https://tools.ietf.org/html/rfc2616

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. However, applications MUST
understand the class of any status code, as indicated by the first
digit, and treat any unrecognized response as being equivalent to the
x00 status code of that class, with the exception that an
unrecognized response MUST NOT be cached. For example, if an
unrecognized status code of 431 is received by the client, it can
safely assume that there was something wrong with its request and
treat the response as if it had received a 400 status code. In such
cases, user agents SHOULD present to the user the entity returned
with the response, since that entity is likely to include human-
readable information which will explain the unusual status.

I'll gladly take a stab at it.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ry picture ry  路  3Comments

motss picture motss  路  3Comments

watilde picture watilde  路  3Comments

ry picture ry  路  3Comments

kitsonk picture kitsonk  路  3Comments