force-http-body

This commit is contained in:
Milo Turner 2020-04-10 21:21:17 -04:00
parent 17b45eb020
commit 77dfb51d14
1 changed files with 7 additions and 0 deletions

View File

@ -10,6 +10,7 @@
http-body? http-body?
empty-http-body empty-http-body
write-http-body write-http-body
force-http-body
in-http-body-chunks) in-http-body-chunks)
(require racket/match (require racket/match
@ -150,6 +151,12 @@
[(? bytes? bs) (list bs)] [(? bytes? bs) (list bs)]
[(? stream? bss) bss])) [(? stream? bss) bss]))
;; (force-http-body bdy) -> void?
;; bdy : http-body?
(define (force-http-body bdy)
(when (stream? bdy)
(for ([x bdy]) (void))))
(define (http-body-additional-headers bdy) (define (http-body-additional-headers bdy)
(match bdy (match bdy
[#f '()] [#f '()]