Skip to content
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/Client.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,10 @@ public function setStream($streamfile = true)
582582
*/
583583
public function getStream()
584584
{
585+
if (!is_null($this->streamName)) {
586+
return $this->streamName;
587+
}
588+
585589
return $this->config['outputstream'];
586590
}
587591

@@ -834,10 +838,6 @@ public function send(Request $request = null)
834838
if (!is_resource($stream) && is_string($stream)) {
835839
$stream = fopen($stream, 'r');
836840
}
837-
if (!is_resource($stream)) {
838-
$stream = $this->getUri()->toString();
839-
$stream = fopen($stream, 'r');
840-
}
841841
$streamMetaData = stream_get_meta_data($stream);
842842
if ($streamMetaData['seekable']) {
843843
rewind($stream);

src/Response.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
namespace Zend\Http;
1212

13+
use Zend\Stdlib\ErrorHandler;
1314
use Zend\Stdlib\ResponseInterface;
1415

1516
/**
@@ -476,7 +477,17 @@ protected function decodeGzip($body)
476477
);
477478
}
478479

479-
return gzinflate(substr($body, 10));
480+
ErrorHandler::start();
481+
$return = gzinflate(substr($body, 10));
482+
$test = ErrorHandler::stop();
483+
if ($test) {
484+
throw new Exception\RuntimeException(
485+
'Error occurred during gzip inflation',
486+
0,
487+
$test
488+
);
489+
}
490+
return $return;
480491
}
481492

482493
/**

0 commit comments

Comments
 (0)