Fix bug with empty consumer buffers which mostly affected Linux
This commit is contained in:
		@@ -44,6 +44,7 @@ public struct GzipServerMiddleware: Middleware, ServiceType {
 | 
			
		||||
                        return data.subdata(in: offset..<offset+readSize)
 | 
			
		||||
                    },
 | 
			
		||||
                    consumer: { data -> Void in
 | 
			
		||||
		    	guard data.count > 0 else { return } // Skip empty buffers
 | 
			
		||||
                        var buffer  = ByteBufferAllocator().buffer(capacity: bufSize)
 | 
			
		||||
                        buffer.write(bytes: data)
 | 
			
		||||
                        write = write.flatMap {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user