Skip to content

Commit

Permalink
Merge pull request #150 from utopia-php/feat-add-compression-header
Browse files Browse the repository at this point in the history
feat: add compression header
  • Loading branch information
christyjacob4 authored Nov 8, 2024
2 parents 247b934 + 7c9e441 commit 354ff0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,6 @@ public function send(string $body = ''): void

$serverHeader = $this->headers['Server'] ?? 'Utopia/Http';
$this->addHeader('Server', $serverHeader);
$this->addHeader('X-Debug-Speed', (string) (microtime(true) - $this->startTime));

$this->appendCookies();

Expand All @@ -544,10 +543,12 @@ public function send(string $body = ''): void
if ($algorithm) {
$body = $algorithm->compress($body);
$this->addHeader('Content-Encoding', $algorithm->getContentEncoding());
$this->addHeader('X-Utopia-Compression', 'true');
$this->addHeader('Vary', 'Accept-Encoding');
}
}

$this->addHeader('X-Debug-Speed', (string) (microtime(true) - $this->startTime));
$this->appendHeaders();

// Send response
Expand Down

0 comments on commit 354ff0d

Please sign in to comment.