diff --git a/Sources/HummingbirdCompression/CompressedBodyWriter.swift b/Sources/HummingbirdCompression/CompressedBodyWriter.swift index 3e721f2..7e2cc56 100644 --- a/Sources/HummingbirdCompression/CompressedBodyWriter.swift +++ b/Sources/HummingbirdCompression/CompressedBodyWriter.swift @@ -18,7 +18,7 @@ import Logging // ResponseBodyWriter that writes a compressed version of the response to a parent writer final class CompressedBodyWriter: ResponseBodyWriter { - let parentWriter: ParentWriter + var parentWriter: ParentWriter let compressor: NIOCompressor var lastBuffer: ByteBuffer? let logger: Logger diff --git a/Tests/HummingbirdCompressionTests/CompressionTests.swift b/Tests/HummingbirdCompressionTests/CompressionTests.swift index 56ee789..31f9745 100644 --- a/Tests/HummingbirdCompressionTests/CompressionTests.swift +++ b/Tests/HummingbirdCompressionTests/CompressionTests.swift @@ -136,10 +136,10 @@ class HummingBirdCompressionTests: XCTestCase { let bufferSize: Int struct Writer: ResponseBodyWriter { - let parentWriter: any ResponseBodyWriter + var parentWriter: any ResponseBodyWriter let bufferSize: Int - func write(_ buffer: ByteBuffer) async throws { + mutating func write(_ buffer: ByteBuffer) async throws { XCTAssertLessThanOrEqual(buffer.capacity, self.bufferSize) try await self.parentWriter.write(buffer) }