Skip to content

Commit d0a8aaa

Browse files
committed
Issue #231 Allow to pass additional headers to send()
1 parent a4f155e commit d0a8aaa

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Pdf.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,14 +593,21 @@ public function saveAs($name)
593593
* streamed inline.
594594
* @param bool $inline whether to force inline display of the PDF, even if
595595
* filename is present.
596+
* @param array $headers a list of additional HTTP headers to send in the
597+
* response as an array. The array keys are the header names like
598+
* 'Cache-Control' and the array values the header value strings to send.
599+
* Each array value can also be another array of strings if the same header
600+
* should be sent multiple times. This can also be used to override
601+
* automatically created headers like 'Expires' or 'Content-Length'. To suppress
602+
* automatically created headers, `false` can also be used as header value.
596603
* @return bool whether PDF was created successfully
597604
*/
598-
public function send($filename = null, $inline = false)
605+
public function send($filename = null, $inline = false, $headers = array())
599606
{
600607
if (!$this->getCommand()->getExecuted() && !$this->execute()) {
601608
return false;
602609
}
603-
$this->getTmpFile()->send($filename, $this->_tmpOutputContentType, $inline);
610+
$this->getTmpFile()->send($filename, $this->_tmpOutputContentType, $inline, $headers);
604611
return true;
605612
}
606613

0 commit comments

Comments
 (0)