mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-18 01:30:27 +02:00
(web response) and (web request): bodies are bytevectors
* module/web/request.scm (read-request-body, write-request-body): Rename from read-request-body/bytevector and write-request-body/bytevector. Remove the /latin-1 variants, as they were unused and a bad idea. * module/web/response.scm (read-response-body, write-response-body): Likewise. * module/web/server/http.scm (http-read, http-write): Adapt to request/response change. * test-suite/tests/web-request.test: * test-suite/tests/web-response.test: Update tests.
This commit is contained in:
parent
ff8339db69
commit
3475fbb572
5 changed files with 22 additions and 104 deletions
|
@ -1,6 +1,6 @@
|
|||
;;; Web I/O: HTTP
|
||||
|
||||
;; Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
;; Copyright (C) 2010, 2011 Free Software Foundation, Inc.
|
||||
|
||||
;; This library is free software; you can redistribute it and/or
|
||||
;; modify it under the terms of the GNU Lesser General Public
|
||||
|
@ -121,7 +121,7 @@
|
|||
(let ((req (read-request port)))
|
||||
(values port
|
||||
req
|
||||
(read-request-body/bytevector req))))
|
||||
(read-request-body req))))
|
||||
(lambda (k . args)
|
||||
(false-if-exception (close-port port)))))))))))))
|
||||
|
||||
|
@ -142,12 +142,10 @@
|
|||
(port (response-port response)))
|
||||
(cond
|
||||
((not body)) ; pass
|
||||
((string? body)
|
||||
(write-response-body/latin-1 response body))
|
||||
((bytevector? body)
|
||||
(write-response-body/bytevector response body))
|
||||
(write-response-body response body))
|
||||
(else
|
||||
(error "Expected a string or bytevector for body" body)))
|
||||
(error "Expected a bytevector for body" body)))
|
||||
(cond
|
||||
((keep-alive? response)
|
||||
(force-output port)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue