Skip to content

Commit

Permalink
fix #1160
Browse files Browse the repository at this point in the history
  • Loading branch information
joyqi committed Sep 10, 2021
1 parent 419183a commit 1ee18ad
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion var/Typecho/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,19 @@ public function sendHeaders()
return;
}

$sentHeaders = [];
foreach (headers_list() as $header) {
[$key] = explode(':', $header, 2);
$sentHeaders[] = strtolower(trim($key));
}

header('HTTP/1.1 ' . $this->status . ' ' . self::HTTP_CODE[$this->status], true, $this->status);

// set header
foreach ($this->headers as $name => $value) {
header($name . ': ' . $value, true);
if (!in_array(strtolower($name), $sentHeaders)) {
header($name . ': ' . $value, true);
}
}

// set cookie
Expand Down

0 comments on commit 1ee18ad

Please sign in to comment.