aidantwoods / aidantwoods/SecureHeaders

allow method chaining

Aperta
#53 13 commenti 0 reazioni 0 assegnatari Vedi su GitHub
feature request
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.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.