[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-153-g09b74
From: |
Andy Wingo |
Subject: |
[Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-153-g09b7459 |
Date: |
Thu, 31 Mar 2011 14:35:55 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=09b7459b49f699a0ef95223bd35a0e88b8437a56
The branch, stable-2.0 has been updated
via 09b7459b49f699a0ef95223bd35a0e88b8437a56 (commit)
via 2ebdf6b5551646804e3adc2fc4a9acb896210f89 (commit)
from 8a12aeb9193a498c0b85c2de4d2ee1543ccb720d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 09b7459b49f699a0ef95223bd35a0e88b8437a56
Author: Andy Wingo <address@hidden>
Date: Thu Mar 31 16:36:01 2011 +0200
web.texi: handler return types documentation
* doc/ref/web.texi (Web Server): More docs on handler return types.
commit 2ebdf6b5551646804e3adc2fc4a9acb896210f89
Author: Andy Wingo <address@hidden>
Date: Thu Mar 31 16:17:35 2011 +0200
web.texi: fix uri->string invocation
* doc/ref/web.texi (Web Examples): Fix uri->string invocation. Thanks
to Romel Sandoval for the report.
-----------------------------------------------------------------------
Summary of changes:
doc/ref/web.texi | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/doc/ref/web.texi b/doc/ref/web.texi
index a72a187..46d4cfb 100644
--- a/doc/ref/web.texi
+++ b/doc/ref/web.texi
@@ -1325,13 +1325,20 @@ If the read failed, the @code{read} hook may return #f
for the client
socket, request, and body.
@item
-A user-provided handler procedure is called, with the request
-and body as its arguments. The handler should return two
-values: the response, as a @code{<response>} record from @code{(web
-response)}, and the response body as a string, bytevector, or
address@hidden if not present. We also allow the response to be simply an
-alist of headers, in which case a default response object is
-constructed with those headers.
+A user-provided handler procedure is called, with the request and body
+as its arguments. The handler should return two values: the response,
+as a @code{<response>} record from @code{(web response)}, and the
+response body as bytevector, or @code{#f} if not present.
+
+The respose and response body are run through @code{sanitize-response},
+documented below. This allows the handler writer to take some
+convenient shortcuts: for example, instead of a @code{<response>}, the
+handler can simply return an alist of headers, in which case a default
+response object is constructed with those headers. Instead of a
+bytevector for the body, the handler can return a string, which will be
+serialized into an appropriate encoding; or it can return a procedure,
+which will be called on a port to write out the data. See the
address@hidden documentation, for more.
@item
The @code{write} hook is called with three arguments: the client
@@ -1575,7 +1582,7 @@ probably know, we'll want to return a 404 response.
(define (not-found request)
(values (build-response #:code 404)
(string-append "Resource not found: "
- (unparse-uri (request-uri request)))))
+ (uri->string (request-uri request)))))
;; Now paste this to let the web server keep going:
,continue
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, stable-2.0, updated. v2.0.0-153-g09b7459,
Andy Wingo <=