web server: do not provide a response body where it is not permitted
authorAndy Wingo <wingo@pobox.com>
Sun, 12 Feb 2012 12:17:11 +0000 (13:17 +0100)
committerAndy Wingo <wingo@pobox.com>
Sun, 12 Feb 2012 12:29:19 +0000 (13:29 +0100)
commit164a78b355908d2149ef1ef266bec26d56b73365
tree98c558ce7b058583230b23d298e58371b6d3c3c6
parent2263ccb53e6017cc89ccb69556a69d3ae7c2ff3b
web server: do not provide a response body where it is not permitted

* module/web/response.scm (response-must-not-include-body?): New
  function.

* doc/ref/web.texi: Doc the function.

* module/web/server.scm (sanitize-response): Error if we have a body,
  but the response type does not permit a body.  If we are responding to
  a HEAD request, silently drop the body.
doc/ref/web.texi
module/web/response.scm
module/web/server.scm