We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 040cf0a commit 92ef510Copy full SHA for 92ef510
1 file changed
src/Messages.jl
@@ -583,8 +583,17 @@ The first chunk of the Message Body (for display purposes).
583
bodysummary(body) = isbytes(body) ? view(bytes(body), 1:min(nbytes(body), BODY_SHOW_MAX[])) : "[Message Body was streamed]"
584
bodysummary(body::Union{AbstractDict, NamedTuple}) = URIs.escapeuri(body)
585
function bodysummary(body::Form)
586
- if length(body.data) == 1 && isa(body.data[1], IOBuffer)
587
- return body.data[1].data[1:body.data[1].ptr-1]
+ if length(body.data) == 1
+ data = body.data[1]
588
+ if data isa Base.GenericIOBuffer && data.seekable
589
+ oldmark = data.mark
590
+ m = mark(data)
591
+ seekstart(data)
592
+ content = read(data, m)
593
+ reset(data)
594
+ data.mark = oldmark
595
+ return content
596
+ end
597
end
598
return "[Message Body was streamed]"
599
0 commit comments