intarweb: add default reason phrases for responses
Currently, intarweb response records have the status code 200 and the reason phrase "OK" as defaults. A common blunder that can happen to an unsuspecting user is to update the code but not the reason phrase, possibly resulting in interesting combinations like "500 OK". Since HTTP 1.0 and 1.1 define a list of recommended reason phrases it would probably make sense to include those in intarweb.
The attached patch changes the default reason phrase to be #f. If a response is written with a reason of #f the list of known status codes is checked for the recommended phrase and is used accordingly. Included are all phrases listed in RFC 2616, section 6.1.1. This list is exported as a parameter so that it can be extended or changed by users (which is explicitly allowed by the RFC). An error is raised if neither a reason is set in the response record nor its code is included in the list of known status codes.
Thanks for the patch and good discussion; we settled on doing it slightly differently in order to prevent hard-to-debug situations where people set just the code on an object that already carries a non-#f reason set by code that ran earlier.
Now if you update the status, the code and reason are set automatically.
Implemented in r25018