From e323f5c6e0f3f6339c7dcb85847ce263adf88f56 Mon Sep 17 00:00:00 2001 From: Julien Ballestracci Date: Thu, 12 Dec 2024 18:27:36 +0100 Subject: [PATCH] feat(Common): check header name in lowercase --- src/Http/HttpMessageHelper.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Http/HttpMessageHelper.php b/src/Http/HttpMessageHelper.php index 52b3d58..b1c4328 100644 --- a/src/Http/HttpMessageHelper.php +++ b/src/Http/HttpMessageHelper.php @@ -31,15 +31,12 @@ public static function formatHeadersForSpanAttribute(array $headers): string return implode(\PHP_EOL, $lines); } - /** - * @param array $headers - */ public static function getContentType(array $headers): string|null { $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); }