xP: fix alternative browsers on iOS
As a rule, they use the same stupid and broken WebKit.
This commit is contained in:
8
xP/xP.go
8
xP/xP.go
@@ -176,9 +176,11 @@ func handleWS(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AppleWebKit can be broken with compression.
|
// AppleWebKit can be broken with compression.
|
||||||
if agent := r.UserAgent(); strings.Contains(agent, " Version/") &&
|
// It would be more reliable to check for 'ApplePaySession' in window in JS,
|
||||||
(strings.HasPrefix(agent, "Mozilla/5.0 (Macintosh; ") ||
|
// and have us disable compression based on a query parameter.
|
||||||
strings.HasPrefix(agent, "Mozilla/5.0 (iPhone; ")) {
|
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
|
opts.CompressionMode = websocket.CompressionDisabled
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user