Skip to content

Commit

Permalink
update to streaming condition
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean O'Brien committed Jun 26, 2023
1 parent 587aff2 commit 9ebd21e
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/RequestCompressionMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,14 @@ private function shouldCompressRequestBody(

private function hasStreamingTraitWithoutRequiresLength($command, $operation)
{
$hasStreaming = false;
$requiresLength = false;
foreach ($operation->getInput()->getMembers() as $name => $member) {
if (!empty($member['streaming']) && isset($command[$name])) {
$hasStreaming = true;
if (!empty($member['requiresLength'])) {
$requiresLength = true;
}
if (!empty($member['streaming'])
&& empty($member['requiresLength'])
&& isset($command[$name])) {
return true;
}
}

return $hasStreaming && !$requiresLength;
return false;
}

private function determineMinimumCompressionSize($config) {
Expand Down

0 comments on commit 9ebd21e

Please sign in to comment.