Skip to content

How can I set custom HTTP Headers #305

Answered by maennchen
apotek asked this question in Q&A
Discussion options

You must be logged in to vote

@apotek The header callback is used to actually set the header. Its arguments are the header name and the value. No return is expected.

Therefore this is not the functionality you need.

Instead, just disable the headers in ZipStream and set the headers yourself. See:

  • protected function sendHttpHeaders(): void
    {
    // grab content disposition
    $disposition = $this->opt->getContentDisposition();
    if ($this->output_name) {
    // Various different browsers dislike various characters here. Strip them all for safety.
    $safe_output = trim(str_replace(['"', "'", '\\', ';', "\n", "\r"], '', $this->ou…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by maennchen
Comment options

You must be logged in to vote
1 reply
@maennchen
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants