Skip to content

Commit 07abd76

Browse files
datamwebddevsr
andcommitted
refactor: normalize native headers once for cleaner comparisons
Co-authored-by: Denny Septian Panggabean <97607754+ddevsr@users.noreply.github.com>
1 parent b4062fb commit 07abd76

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

system/Debug/Toolbar.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,9 @@ protected function hasNativeHeaderConflict(): bool
562562
// Native Header Inspection
563563
foreach (headers_list() as $header) {
564564
// Content-Type is set but is NOT text/html
565-
if (str_starts_with(strtolower($header), strtolower('Content-Type:')) && ! str_contains(strtolower($header), strtolower('text/html'))) {
565+
$lowercaseHeader = strtolower($header);
566+
567+
if (str_starts_with($lowercaseHeader, 'content-type:') && ! str_contains($lowercaseHeader, 'text/html')) {
566568
return true;
567569
}
568570
// File is being downloaded (Attachment)

0 commit comments

Comments
 (0)