diff options
Diffstat (limited to 'xP')
| -rw-r--r-- | xP/xP.go | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -176,9 +176,11 @@ func handleWS(w http.ResponseWriter, r *http.Request) { } // AppleWebKit can be broken with compression. - if agent := r.UserAgent(); strings.Contains(agent, " Version/") && - (strings.HasPrefix(agent, "Mozilla/5.0 (Macintosh; ") || - strings.HasPrefix(agent, "Mozilla/5.0 (iPhone; ")) { + // It would be more reliable to check for 'ApplePaySession' in window in JS, + // and have us disable compression based on a query parameter. + if agent := r.UserAgent(); (strings.Contains(agent, " Version/") && + strings.HasPrefix(agent, "Mozilla/5.0 (Macintosh; ")) || + strings.HasPrefix(agent, "Mozilla/5.0 (iPhone; ") { opts.CompressionMode = websocket.CompressionDisabled } |
