From 435b883f5cf1839cb2f4089e2bfa6e2e5427aced Mon Sep 17 00:00:00 2001 From: sterni Date: Tue, 6 Apr 2021 15:02:58 +0200 Subject: fix(panettone): set external-format for stream from cheddar drakma ignores the :external-format-in parameter if :want-stream is t: > If want-stream is true, the message body is NOT read and instead > the (open) socket stream is returned as the first return value. > If the sixth value of HTTP-REQUEST is true, the stream should be > closed (and not be re-used) after the body has been read. The > stream returned is a flexi-stream with a chunked stream as its > underlying stream. If you want to read binary data from this > stream, read from the underlying stream which you can get with > FLEXI-STREAM-STREAM. Since it doesn't return a plain CL stream which would just work with SBCL, we need to set the external format on the resulting flexi-stream. Fixes b/107. Change-Id: I6e3178123c0927ef21fabf8118d9d357c8afbd42 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2869 Tested-by: BuildkiteCI Reviewed-by: tazjin Reviewed-by: glittershark --- web/panettone/src/panettone.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/panettone/src/panettone.lisp b/web/panettone/src/panettone.lisp index 52908e1478..2f15dbff0a 100644 --- a/web/panettone/src/panettone.lisp +++ b/web/panettone/src/panettone.lisp @@ -19,9 +19,9 @@ :method :post :content-type "application/json" :external-format-out :utf-8 - :external-format-in :utf-8 :content (json:encode-json-to-string input) :want-stream t))) + (setf (flexi-streams:flexi-stream-external-format s) :utf-8) (cl-json:decode-json s))) (defmethod render-markdown ((markdown string)) -- cgit 1.4.1