Skip to content

Commit

Permalink
Fix #11
Browse files Browse the repository at this point in the history
Allow permessage-deflate extension header without value for client_max_window_bits in server mode.
  • Loading branch information
trowski committed Oct 21, 2023
1 parent f40de82 commit 498bec7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/Compression/Rfc7692Compression.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,18 @@ private static function fromHeader(bool $isServer, string $headerIn, ?string &$h

switch ($parts[0]) {
case 'client_max_window_bits':
if (!isset($parts[1])) {
return null;
}
if (isset($parts[1])) {
$value = (int) $parts[1];

$value = (int) $parts[1];
if ($value < 9 || $value > 15) {
return null; // Invalid option value.
}

if ($value < 9 || $value > 15) {
return null; // Invalid option value.
$clientWindowSize = $value;
} elseif (!$isServer) {
return null;
}

$clientWindowSize = $value;

$headerOut .= '; client_max_window_bits=' . $clientWindowSize;
break;

Expand Down

0 comments on commit 498bec7

Please sign in to comment.