Skip to content

Commit acfc7a2

Browse files
committed
Add mailto: to CSP frame-src directive
Allow mailto links on the deleteme page to work without being blocked by Content Security Policy.
1 parent 0b882af commit acfc7a2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

backend/app/rest/api/rest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ func securityHeadersMiddleware(imageProxyEnabled bool, allowedAncestors []string
631631
log.Printf("[INFO] frame embedding allowed from %+v only", allowedAncestors)
632632
frameAncestors = strings.Join(allowedAncestors, " ")
633633
}
634-
w.Header().Set("Content-Security-Policy", fmt.Sprintf("default-src 'none'; base-uri 'none'; form-action 'none'; connect-src 'self'; frame-src 'self'; img-src %s; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; font-src data:; object-src 'none'; frame-ancestors %s;", imgSrc, frameAncestors))
634+
w.Header().Set("Content-Security-Policy", fmt.Sprintf("default-src 'none'; base-uri 'none'; form-action 'none'; connect-src 'self'; frame-src 'self' mailto:; img-src %s; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; font-src data:; object-src 'none'; frame-ancestors %s;", imgSrc, frameAncestors))
635635
w.Header().Set("Permissions-Policy", "accelerometer=(), autoplay=(), camera=(), cross-origin-isolated=(), display-capture=(), encrypted-media=(), fullscreen=(), geolocation=(), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), payment=(), picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), xr-spatial-tracking=(), clipboard-read=(), clipboard-write=(), gamepad=(), hid=(), idle-detection=(), interest-cohort=(), serial=(), unload=(), window-management=()")
636636
next.ServeHTTP(w, r)
637637
})

0 commit comments

Comments
 (0)