aboutsummaryrefslogtreecommitdiff
path: root/xP
diff options
context:
space:
mode:
Diffstat (limited to 'xP')
-rw-r--r--xP/xP.go8
1 files changed, 5 insertions, 3 deletions
diff --git a/xP/xP.go b/xP/xP.go
index 7e0c386..9173afc 100644
--- a/xP/xP.go
+++ b/xP/xP.go
@@ -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
}