summaryrefslogtreecommitdiff
path: root/doc/ref/web.texi
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2012-02-12 13:17:11 +0100
committerAndy Wingo <wingo@pobox.com>2012-02-12 13:29:19 +0100
commit164a78b355908d2149ef1ef266bec26d56b73365 (patch)
tree98c558ce7b058583230b23d298e58371b6d3c3c6 /doc/ref/web.texi
parent2263ccb53e6017cc89ccb69556a69d3ae7c2ff3b (diff)
downloadguile-164a78b355908d2149ef1ef266bec26d56b73365.tar.gz
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.
Diffstat (limited to 'doc/ref/web.texi')
-rw-r--r--doc/ref/web.texi10
1 files changed, 9 insertions, 1 deletions
diff --git a/doc/ref/web.texi b/doc/ref/web.texi
index 81c77dd0b..8bb99e21f 100644
--- a/doc/ref/web.texi
+++ b/doc/ref/web.texi
@@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
-@c Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+@c Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
@node Web
@@ -1235,6 +1235,14 @@ Return a new response, whose @code{response-port} will continue writing
on @var{port}, perhaps using some transfer encoding.
@end deffn
+@deffn {Scheme Procedure} response-must-not-include-body? r
+Some responses, like those with status code 304, are specified as never
+having bodies. This predicate returns @code{#t} for those responses.
+
+Note also, though, that responses to @code{HEAD} requests must also not
+have a body.
+@end deffn
+
@deffn {Scheme Procedure} read-response-body r
Read the response body from @var{r}, as a bytevector. Returns @code{#f}
if there was no response body.