OSDN Git Service

BugTrack/2463 Output HTTP custom response headers
authorumorigu <umorigu@gmail.com>
Sun, 25 Mar 2018 09:30:17 +0000 (18:30 +0900)
committerumorigu <umorigu@gmail.com>
Sun, 25 Mar 2018 09:30:17 +0000 (18:30 +0900)
Config: $http_response_custom_headers in pukiwiki.ini.php

lib/html.php
pukiwiki.ini.php

index 94d1c29..db58c49 100644 (file)
@@ -606,8 +606,11 @@ function pkwk_headers_sent()
 // Output common HTTP headers
 function pkwk_common_headers()
 {
+       global $http_response_custom_headers;
        if (! PKWK_OPTIMISE) pkwk_headers_sent();
-
+       foreach ($http_response_custom_headers as $header) {
+               header($header);
+       }
        if(defined('PKWK_ZLIB_LOADABLE_MODULE')) {
                $matches = array();
                if(ini_get('zlib.output_compression') &&
index 336233a..ac5b184 100644 (file)
@@ -340,6 +340,13 @@ $external_link_cushion = array(
 $html_meta_referrer_policy = '';
 
 /////////////////////////////////////////////////
+// Output custom HTTP response headers
+$http_response_custom_headers = array(
+       // 'Strict-Transport-Security: max-age=86400',
+       // 'X-Content-Type-Options: nosniff',
+);
+
+/////////////////////////////////////////////////
 // $whatsnew: Max number of RecentChanges
 $maxshow = 500;