The GzipEncodeStream::getSize returns the size of the inner stream content.
Expected Behavior
The GzipEncodeStream::getSize should return the size of the gzipped body.
Steps to Reproduce
<?php
require 'vendor/autoload.php';
$payload = 'This is a test stream';
$innerStream = new spec\Http\Message\Encoding\MemoryStream($payload);
$gzipEncodedStream = new Http\Message\Encoding\GzipEncodeStream($innerStream);
var_dump($gzipEncodedStream->getContents() === gzencode($payload)); //It is true
var_dump($gzipEncodedStream->getSize() === strlen(gzencode($payload))); //Should be true
Actual Behavior
The
GzipEncodeStream::getSize
returns the size of the inner stream content.Expected Behavior
The
GzipEncodeStream::getSize
should return the size of the gzipped body.Steps to Reproduce