Skip to content

Commit

Permalink
feat(Common): check header name in lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
neiluJ committed Dec 12, 2024
1 parent 0c73dc9 commit e323f5c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/Http/HttpMessageHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,12 @@ public static function formatHeadersForSpanAttribute(array $headers): string
return implode(\PHP_EOL, $lines);
}

/**
* @param array<string,string|string[]> $headers
*/
public static function getContentType(array $headers): string|null

Check failure on line 34 in src/Http/HttpMessageHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3)

Method Instrumentation\Http\HttpMessageHelper::getContentType() has parameter $headers with no value type specified in iterable type array.

Check failure on line 34 in src/Http/HttpMessageHelper.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.3)

Method Instrumentation\Http\HttpMessageHelper::getContentType() has parameter $headers with no value type specified in iterable type array.
{
$headers = HttpSensitiveDataHelper::filterHeaders($headers);

foreach ($headers as $name => $values) {
if ('Content-Type' === $name) {
if ('content-type' === strtolower($name)) {
if (\is_array($values)) {
return array_shift($values);
}
Expand Down

0 comments on commit e323f5c

Please sign in to comment.