mirror of
https://github.com/siderolabs/omni.git
synced 2026-05-05 06:36:12 +02:00
feat: add hsts header for omni frontend
Add HSTS (Strict-Transport-Security) response header to the frontend Signed-off-by: Edward Sammut Alessi <edward.sammutalessi@siderolabs.com>
This commit is contained in:
parent
385c512d4c
commit
6d52a6970c
@ -110,6 +110,9 @@ func (handler *StaticHandler) serveFile(w http.ResponseWriter, r *http.Request,
|
||||
|
||||
defer file.Close() //nolint:errcheck
|
||||
|
||||
w.Header().Set("Strict-Transport-Security", "max-age=31536000; includeSubDomains")
|
||||
w.Header().Set("X-Content-Type-Options", "nosniff")
|
||||
|
||||
if path != index {
|
||||
w.Header().Set("Vary", "Accept-Encoding, User-Agent")
|
||||
w.Header().Set("Cache-Control", fmt.Sprintf("public, max-age=%d, immutable", handler.maxAgeSec))
|
||||
@ -143,7 +146,6 @@ func (handler *StaticHandler) serveFile(w http.ResponseWriter, r *http.Request,
|
||||
)
|
||||
|
||||
w.Header().Set("X-Frame-Options", "SAMEORIGIN")
|
||||
w.Header().Set("X-Content-Type-Options", "nosniff")
|
||||
w.Header().Set("Permissions-Policy", "accelerometer=(), ambient-light-sensor=(), "+
|
||||
"autoplay=(self), battery=(), camera=(), cross-origin-isolated=(self), display-capture=(), "+
|
||||
"document-domain=(), encrypted-media=(), fullscreen=(self), geolocation=(), gyroscope=(), "+
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user