jshttp/statuses

missing status codes

Closed this issue · 15 comments

Status code registry:
http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml

... defines at least three status codes (208, 226, 508) that aren't present in http.STATUS_CODES. Does it make sense to add them here?

Also, 451. Not a standard yet, but unfortunately is very popular where I'm from. :(

i dunno. @dougwilson ? as long as its a standard, i'd say why not. maybe make a PR to joyent as well.

Yes, we should list all registered statuses, even if node doesn't list them in my opinion.

IANA registry doesn't have 418 listed. We totally need that one. :P

LOL, no tea here.

Here is a request for 440: koajs/koa#350

It isn't a standard, but people use it. I think we should support all of those. Otherwise what this module is good for, if you can get the same information from http.STATUS_CODES?

I think we should just add all the codes. Id rather make people happy than try to strictly comply to the specs.

than try to strictly comply to the specs

The specs itself doesn't say you can't use unregistered status codes. It in fact says there can be codes added in the future. i.m.o. this module should only have the known codes, and the koa issue is a little bit different from this issue, in that it should only check if the codes are well-formed, rather than known.

what does well-formed mean? basically just >= 100?

Yea. I would say >= 100 < 600, but there may be some way to use >= 600, but I haven't read specs about it yet.

lol apparently node has some status codes that isn't in the IANA, specifically 425 - "unordered collection"

i added all the ones mentioned. there are a bunch of nginx/apache/microsoft/webdev i haven't bothered to add yet

Right. I believe 425 is in WebDAV. It is likely that the non-IANA ones are going to have conflicts, though.

i.m.o. this module has just become even more useful :)