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