about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2021-04-06T13·02+0200
committersterni <sternenseemann@systemli.org>2021-04-06T16·34+0000
commit435b883f5cf1839cb2f4089e2bfa6e2e5427aced (patch)
treee67f7be3902729dfb25b5898727cee3a74fd08a7
parent63a0b28bea0cd2829334a880bbdf930c78fd9866 (diff)
fix(panettone): set external-format for stream from cheddar r/2449
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 <mail@tazj.in>
Reviewed-by: glittershark <grfn@gws.fyi>
-rw-r--r--web/panettone/src/panettone.lisp2
1 files changed, 1 insertions, 1 deletions
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))