Skip to content

Commit 507f167

Browse files
committed
fix compression algo pick with wrong array keys
1 parent d87cd0e commit 507f167

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/ResponseCompression.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,11 @@ protected function shouldCompressUsing($request): ?array
101101
$preferenceList = array_merge($preferenceList, array_diff(array_keys($supportedList), $preferenceList));
102102
}
103103

104-
$fromSupportedList = array_intersect(
104+
$fromSupportedList = array_values(array_intersect(
105105
$preferenceList ?: $clientSupportedList,
106106
$clientSupportedList,
107107
array_keys($supportedList)
108-
);
108+
));
109109

110110
if ($fromSupportedList[0] ?? false) {
111111
return [$fromSupportedList[0], $supportedList[$fromSupportedList[0]]];

0 commit comments

Comments
 (0)