Skip to content

Commit

Permalink
Replace addHeader with setHeader
Browse files Browse the repository at this point in the history
Because addHeader doesn't replace already defined headers. Content-Type is already defined in HttpExtension in nette/http. Since nginx 1.23 it leads to malfunction.
  • Loading branch information
thorewi authored and f3l1x committed Jan 9, 2023
1 parent b5cbe9a commit fe5e483
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Response/StringResponse.php
Expand Up @@ -48,8 +48,8 @@ public function setAttachment(bool $attachment = true): self

public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse): void
{
$httpResponse->addHeader('Content-Type', $this->contentType);
$httpResponse->addHeader(
$httpResponse->setHeader('Content-Type', $this->contentType);
$httpResponse->setHeader(
'Content-Disposition',
($this->attachment ? 'attachment;' : '') . 'filename="' . $this->name . '"'
);
Expand Down

0 comments on commit fe5e483

Please sign in to comment.