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

View File

@@ -347,6 +347,11 @@ func SecurityHeadersMiddleware(next http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) { fn := func(w http.ResponseWriter, r *http.Request) {
c := config.GetInstance() c := config.GetInstance()
connectableOrigins := "connect-src data: 'self'" 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() != "" { if !c.IsNewSystem() && c.GetHandyKey() != "" {
connectableOrigins += " https://www.handyfeeling.com" connectableOrigins += " https://www.handyfeeling.com"
} }