Files
picoclaw/web/backend/middleware/referrer_policy.go
T
wenjie 71c877a67f refactor(web): switch dashboard auth from tokens to passwords (#2608)
- replace token-based launcher auth with password-based login and sessions
- migrate legacy launcher_token values into bcrypt-backed password storage
- add one-shot local auto-login bootstrap
- update config UI, i18n strings, docs, and auth-related tests
2026-04-21 18:04:15 +08:00

13 lines
417 B
Go

package middleware
import "net/http"
// ReferrerPolicyNoReferrer sets Referrer-Policy: no-referrer on every response
// so sensitive paths and query parameters are not leaked via the Referer header.
func ReferrerPolicyNoReferrer(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Referrer-Policy", "no-referrer")
next.ServeHTTP(w, r)
})
}