从http头发现android ios windows mobile http\u用户\u代理可靠性?
这种方法是否正确且不易产生歧义 我将HTTP_USER_AGENT的全部内容拆分为文字,并检查:从http头发现android ios windows mobile http\u用户\u代理可靠性?,android,ios,mobile,http-headers,windows-mobile,Android,Ios,Mobile,Http Headers,Windows Mobile,这种方法是否正确且不易产生歧义 我将HTTP_USER_AGENT的全部内容拆分为文字,并检查: if there is `iPhone` -> iOS if there is `Android` -> Android if there is `Windows` -> Windows Mobile else -> no mobile 首先你忘了“iPod”是iOS 其次,这是检测设备的唯一方法,但根本不安全。 标题可以很容易地更改,你甚至可以找到chrome或firef
if there is `iPhone` -> iOS
if there is `Android` -> Android
if there is `Windows` -> Windows Mobile
else -> no mobile
首先你忘了“iPod”是iOS
其次,这是检测设备的唯一方法,但根本不安全。
标题可以很容易地更改,你甚至可以找到chrome或firefox插件,让你自定义你的标题,以满足你的需要
如果只是出于混淆目的的检测:你有一部iPhone,让我们给你看一张漂亮的苹果图片,那么没关系,改变用户代理的人知道他们在做什么
如果这是一个安全性或“它必须是不可伪造的”场景,那么这根本不起作用,因为它很容易被欺骗
如果您正在使用本机应用程序,最好使用GET或POST变量发送平台名称,并使用HTTPS避免您的变量被篡改