Skip to content

Commit

Permalink
fix(streamable): Append read stream buffer to ongoing response for lo…
Browse files Browse the repository at this point in the history
…ng items

Process output is streamed into a buffer. By default this buffer fits 4k characters, which is too short for image data.
With this change, if this block does not contain a stream separator, the complete block is appended to the in-progress content stored so far.
Fixes swiftbar#371.
  • Loading branch information
peanball committed Apr 8, 2023
1 parent 5c35f33 commit 7c14349
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion SwiftBar/Plugin/StreamablePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class StreamablePlugin: Plugin {
self?.content = nil
return
}
guard str.contains("\n") else {
guard str.contains("\n") || !str.contains(streamSeparator) else {
self?.streamInProgressContent.append(contentsOf: str)
return
}
Expand Down

0 comments on commit 7c14349

Please sign in to comment.