We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5aef47 commit 6ff0a0cCopy full SHA for 6ff0a0c
Sources/SmithyStreams/StreamableHttpBody.swift
@@ -111,10 +111,15 @@ public class StreamableHttpBody: IStreamable {
111
}
112
113
public func isEndOfStream() -> Bool {
114
- do {
115
- return try self.position >= self.length()
116
- } catch {
117
- return false
+ switch body {
+ case .data(let data):
+ guard let data = data else { return true }
+ return position >= data.endIndex
118
+ case .stream(let stream):
119
+ guard let length = stream.length else { return false }
120
+ return stream.position >= length
121
+ case .noStream:
122
+ return true
123
124
125
0 commit comments