aidantwoods / aidantwoods/SecureHeaders
allow method chaining
- Lingua principale
- PHP
- Stelle
- 433
- Fork
- 21
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Personally, I'd like to chain my settings, so instead of this:
```php
// init SecureHeaders
$headers = new SecureHeaders;
$headers->auto();
$headers->hsts();
$headers->csp([
'default-src' => [
'none'
],
'script-src' => [
'self'
],
'style-src' => [
'self',
'https://fonts.googleapis.com'
],
'img-src' => [
'https://www.gravatar.com'
]
]);
$headers->apply();
```
I could do
```php
// init SecureHeaders
$headers = new SecureHeaders;
$headers
->auto()
->hsts()
->csp([
'default-src' => [
'none'
],
'script-src' => [
'self'
],
'style-src' => [
'self',
'https://fonts.googleapis.com'
],
'img-src' => [
'https://www.gravatar.com'
]
])
->apply();
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.