Skip to content

Commit

Permalink
Ignore empty values for client hints (#7949)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl authored Dec 15, 2024
1 parent 822deea commit fa35190
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ClientHints.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ public static function factory(array $headers): ClientHints
$formFactors = [];

foreach ($headers as $name => $value) {
if (empty($value)) {
continue;
}

switch (\str_replace('_', '-', \strtolower((string) $name))) {
case 'http-sec-ch-ua-arch':
case 'sec-ch-ua-arch':
Expand Down

0 comments on commit fa35190

Please sign in to comment.