File tree Expand file tree Collapse file tree 1 file changed +1
-3
lines changed
Sources/AsyncHTTPClient/AsyncAwait Expand file tree Collapse file tree 1 file changed +1
-3
lines changed Original file line number Diff line number Diff line change 13
13
//===----------------------------------------------------------------------===//
14
14
15
15
import NIOCore
16
- import NIOHTTP1
17
16
#if canImport(FoundationEssentials)
18
17
import FoundationEssentials
19
18
#else
@@ -27,8 +26,7 @@ extension HTTPClientResponse {
27
26
/// - Parameter maxBytes: The maximum number of bytes this method is allowed to accumulate.
28
27
/// - Returns: Bytes collected over time
29
28
public func bytes( upTo maxBytes: Int ) async throws -> ByteBuffer {
30
- let expectedBytes = self . headers. first ( name: " content-length " ) . flatMap ( Int . init) ?? maxBytes
31
- return try await self . body. collect ( upTo: min ( expectedBytes, maxBytes) )
29
+ return try await self . body. collect ( upTo: maxBytes)
32
30
}
33
31
}
34
32
You can’t perform that action at this time.
0 commit comments