feat: cross origin opener policy options (#10710)

isekai-main
Barış Soner Uşaklı 3 years ago committed by GitHub
parent 20b75b24ad
commit 881323583f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -154,6 +154,7 @@
"digestHour": 17,
"passwordExpiryDays": 0,
"cross-origin-embedder-policy": 0,
"cross-origin-opener-policy": "same-origin",
"cross-origin-resource-policy": "same-origin",
"hsts-maxage": 31536000,
"hsts-subdomains": 0,

@ -17,6 +17,7 @@
"headers.acah": "Access-Control-Allow-Headers",
"headers.coep": "Cross-Origin-Embedder-Policy",
"headers.coep-help": "When enabled (default), will set the header to <code>require-corp</code>",
"headers.coop": "Cross-Origin-Opener-Policy",
"headers.corp": "Cross-Origin-Resource-Policy",
"hsts": "Strict Transport Security",
"hsts.enabled": "Enabled HSTS (recommended)",

@ -73,6 +73,15 @@
</label>
</div>
<p class="help-block">[[admin/settings/advanced:headers.coep-help]]</p>
<div class="form-group">
<label for="cross-origin-resource-policy">[[admin/settings/advanced:headers.coop]]</label>
<select class="form-control" id="cross-origin-opener-policy" data-field="cross-origin-opener-policy">
<option value="same-origin">same-origin</option>
<option value="same-origin-allow-popups">same-origin-allow-popups</option>
<option value="unsafe-none">unsafe-none</option>
</select>
</div>
<div class="form-group">
<label for="cross-origin-resource-policy">[[admin/settings/advanced:headers.corp]]</label>
<select class="form-control" id="cross-origin-resource-policy" data-field="cross-origin-resource-policy">

@ -196,7 +196,7 @@ function setupHelmet(app) {
if (meta.config['cross-origin-embedder-policy']) {
app.use(helmet.crossOriginEmbedderPolicy());
}
app.use(helmet.crossOriginOpenerPolicy());
app.use(helmet.crossOriginOpenerPolicy({ policy: meta.config['cross-origin-opener-policy'] }));
app.use(helmet.crossOriginResourcePolicy({ policy: meta.config['cross-origin-resource-policy'] }));
app.use(helmet.dnsPrefetchControl());
app.use(helmet.expectCt());

Loading…
Cancel
Save