From 77dfb51d14d79b1e26132bccca1674fb00937b44 Mon Sep 17 00:00:00 2001 From: Milo Turner Date: Fri, 10 Apr 2020 21:21:17 -0400 Subject: [PATCH] force-http-body --- smol-http/http-msg.rkt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/smol-http/http-msg.rkt b/smol-http/http-msg.rkt index afd4bca..396bef0 100644 --- a/smol-http/http-msg.rkt +++ b/smol-http/http-msg.rkt @@ -10,6 +10,7 @@ http-body? empty-http-body write-http-body + force-http-body in-http-body-chunks) (require racket/match @@ -150,6 +151,12 @@ [(? bytes? bs) (list bs)] [(? 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) (match bdy [#f '()]