WebSocket 链接的 User-Agent 异常
- 当前 Bug 的表现(可附上截图)
我们有API会把完整的HTTP请求报文返回给客户端,客户端再通过云函数,把 HTTP报文 加上openid 返回给后台,来确定不是爬虫的行为
目前收到异常的 HTTP 报文:
GET /xxx HTTP/1.1Host: xxxConnection: upgradeSec-Websocket-Key: zm7HEXzq+AbnYMK\/Bdvt2g==Sec-Websocket-Version: 13Upgrade: websocketUser-Agent: WebSocket++/0.8.1 |
报文里的 User-Agent 不是小程序的,也没有客户端设置的认证信息
客户端具体信息:
{ "SDKVersion": "2.6.6", "albumAuthorized": true, "batteryLevel": 54, "bluetoothEnabled": false, "brand": "iPhone", "cameraAuthorized": true, "deviceOrientation": "portrait", "fontSizeSetting": 17, "language": "zh_CN", "locationAuthorized": true, "locationEnabled": true, "microphoneAuthorized": true, "model": "iPhone 7<iPhone9,1>", "notificationAlertAuthorized": true, "notificationAuthorized": true, "notificationBadgeAuthorized": true, "notificationSoundAuthorized": true, "pixelRatio": 2, "platform": "ios", "screenHeight": 667, "screenWidth": 375, "statusBarHeight": 20, "system": "iOS 12.1", "version": "7.0.3", "wifiEnabled": true, "windowHeight": 603, "windowWidth": 375} |
-
预期表现
-
复现路径
-
提供一个最简复现 Demo
