forked from kalpaitch/http_response_headers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
http_response_headers.module
38 lines (31 loc) · 1.04 KB
/
http_response_headers.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
* @file
* HTTP Header manipulations module.
*/
use Drupal\Core\Url;
use Drupal\Core\Link;
use Drupal\Core\Routing\RouteMatchInterface;
/**
* Implements hook_help().
*/
function http_response_headers_help($route_name, RouteMatchInterface $route_match) {
if ($route_name !== 'help.page.http_response_headers') {
return '';
}
$output = '<h3>HTTP Repsonse Headers Help</h3>';
$output .= 'This module provides basic security headers by default. But in most cases will require further configuration based on your requirements.';
$help = [
'#theme' => 'item_list',
'#list_type' => 'ul',
'#title' => 'For more information about security headers visit:',
'#items' => [
Link::fromTextAndUrl('securityheaders.io', Url::fromUri('https://securityheaders.io/')),
Link::fromTextAndUrl('scotthelme.co.uk', Url::fromUri('https://scotthelme.co.uk/')),
],
'#attributes' => ['class' => 'help-resources'],
'#wrapper_attributes' => ['class' => 'container'],
];
$output .= render($help);
return $output;
}