• R/O
  • HTTP
  • SSH
  • HTTPS

pukiwiki: Commit


Commit MetaInfo

Revisiona7765600bf6bcb68d7ee0b6452e5086165d9e74f (tree)
Time2018-03-25 18:30:17
Authorumorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/2463 Output HTTP custom response headers

Config: $http_response_custom_headers in pukiwiki.ini.php

Change Summary

Incremental Difference

--- a/lib/html.php
+++ b/lib/html.php
@@ -606,8 +606,11 @@ function pkwk_headers_sent()
606606 // Output common HTTP headers
607607 function pkwk_common_headers()
608608 {
609+ global $http_response_custom_headers;
609610 if (! PKWK_OPTIMISE) pkwk_headers_sent();
610-
611+ foreach ($http_response_custom_headers as $header) {
612+ header($header);
613+ }
611614 if(defined('PKWK_ZLIB_LOADABLE_MODULE')) {
612615 $matches = array();
613616 if(ini_get('zlib.output_compression') &&
--- a/pukiwiki.ini.php
+++ b/pukiwiki.ini.php
@@ -340,6 +340,13 @@ $external_link_cushion = array(
340340 $html_meta_referrer_policy = '';
341341
342342 /////////////////////////////////////////////////
343+// Output custom HTTP response headers
344+$http_response_custom_headers = array(
345+ // 'Strict-Transport-Security: max-age=86400',
346+ // 'X-Content-Type-Options: nosniff',
347+);
348+
349+/////////////////////////////////////////////////
343350 // $whatsnew: Max number of RecentChanges
344351 $maxshow = 500;
345352
Show on old repository browser