Merge pull request #207 from jolt-lang/fix/io-copy-htable-input-stream
io/copy: drain a byte-input-stream shim source
This commit is contained in:
commit
93b4d101a1
1 changed files with 4 additions and 0 deletions
|
|
@ -275,6 +275,10 @@
|
|||
(cond ((in-stream? input) (let ((bv (get-bytevector-all (in-stream-port input)))) (if (eof-object? bv) (make-bytevector 0) bv)))
|
||||
((bytevector? input) input)
|
||||
((and (jolt-array? input) (eq? (jolt-array-kind input) 'byte)) (na-bytearray->bv input))
|
||||
;; a byte-input-stream shim (host tagged-table, :jolt/input-stream — e.g.
|
||||
;; http-client's ByteArrayInputStream): drain it byte-exact, like slurp.
|
||||
((and (htable? input) (jolt-truthy? (jolt-ref-get input (keyword "jolt" "input-stream"))))
|
||||
(drain-byte-stream input))
|
||||
(else #f)))
|
||||
(define (input-text input)
|
||||
(cond ((string? input) input)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue