Skip to content

Commit

Permalink
update feature-policy header (#3193)
Browse files Browse the repository at this point in the history
Updates the Feature-Policy header to a Permissions-Policy header.

Also, add hidden username fields to some forms to suppress console warnings.
  • Loading branch information
buck54321 authored Feb 21, 2025
1 parent e768762 commit 744f397
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/webserver/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func (s *WebServer) securityMiddleware(next http.Handler) http.Handler {
w.Header().Set("X-Content-Type-Options", "nosniff")
w.Header().Set("Referrer-Policy", "no-referrer")
w.Header().Set("Content-Security-Policy", s.csp)
w.Header().Set("Feature-Policy", "geolocation 'none'; midi 'none'; notifications 'none'; push 'none'; sync-xhr 'self'; microphone 'none'; camera 'none'; magnetometer 'none'; gyroscope 'none'; speaker 'none'; vibrate 'none'; fullscreen 'self'; payment 'none'")
w.Header().Set("Permissions-Policy", "geolocation=(), midi=(), sync-xhr=(self), microphone=(), camera=(), magnetometer=(), gyroscope=(), fullscreen=(self), payment=()")
next.ServeHTTP(w, r)
})
}
Expand Down
1 change: 1 addition & 0 deletions client/webserver/site/src/html/init.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<span class="ico-locked fs20 grey me-2"></span>
<span>[[[Set App Password]]]</span>
</header>
<input type="text" name="username" autocomplete="username" class="d-hide"> <!-- to suppress console warning -->
<div class="fs18">[[[reg_set_app_pw_msg]]]</div>
<div class="mt-3 border-top">
<label for="appPW">[[[Password]]]</label>
Expand Down
1 change: 1 addition & 0 deletions client/webserver/site/src/html/wallets.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@
<div id="exportDisclaimer">
[[[export_wallet_disclaimer]]]
</div>
<input type="text" name="username" autocomplete="username" class="d-hide"> <!-- to suppress console warning -->
<div class="text-start">
<label for="exportWalletPW">[[[Password]]]</label>
<input type="password" id="exportWalletPW" autocomplete="current-password">
Expand Down

0 comments on commit 744f397

Please sign in to comment.