Skip to content

Commit f055a71

Browse files
committed
Fix header case sensitivity
1 parent 190d2d2 commit f055a71

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/Response.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,9 +669,17 @@ public function send(string $body = ''): void
669669

670670
$this->appendCookies();
671671

672+
$hasContentEncoding = false;
673+
foreach ($this->headers as $name => $values) {
674+
if (\strtolower($name) === 'content-encoding') {
675+
$hasContentEncoding = true;
676+
break;
677+
}
678+
}
679+
672680
// Compress body only if all conditions are met:
673681
if (
674-
empty($this->headers['content-encoding']) &&
682+
!$hasContentEncoding &&
675683
!empty($this->acceptEncoding) &&
676684
$this->isCompressible($this->contentType) &&
677685
strlen($body) > $this->compressionMinSize

0 commit comments

Comments
 (0)