Invalid value returned by GzipEncodeStream::getSize
Closed this issue · 1 comments
ajgarlag commented
| Q | A |
|---|---|
| Bug? | yes |
| New Feature? | no |
| Version | b86b453 |
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
<?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 truedbu commented
i am pretty sure you are correct and we should fix this.