Skip to content

Commit

Permalink
Ignore empty values for client hints
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl committed Dec 13, 2024
1 parent 822deea commit 7b0ebca
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 7b0ebca

Please sign in to comment.