Fix Safari websockets requests (#2128)

This commit is contained in:
kermieisinthehouse 2021-12-15 10:07:12 +00:00 committed by GitHub
parent 920ad1074f
commit bbe99a0dd8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -347,6 +347,11 @@ func SecurityHeadersMiddleware(next http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
c := config.GetInstance()
connectableOrigins := "connect-src data: 'self'"
// Workaround Safari bug https://bugs.webkit.org/show_bug.cgi?id=201591
// Allows websocket requests to any origin
connectableOrigins += " ws: wss:"
if !c.IsNewSystem() && c.GetHandyKey() != "" {
connectableOrigins += " https://www.handyfeeling.com"
}