w-ipproxy 1.0.17 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/w-ipproxy.umd.js +2 -2
- package/dist/w-ipproxy.umd.js.map +1 -1
- package/docs/WIpProxy.html +70 -7
- package/docs/WIpProxy.mjs.html +610 -517
- package/docs/index.html +1 -1
- package/package.json +4 -4
- package/src/WIpProxy.mjs +609 -516
- package/test/anonymity.test.mjs +3 -3
- package/toolg/gDistRollup.mjs +4 -0
package/test/anonymity.test.mjs
CHANGED
|
@@ -19,19 +19,19 @@ function normalizeIp(v) {
|
|
|
19
19
|
else if (s.split(':').length === 2) {
|
|
20
20
|
s = s.split(':')[0]
|
|
21
21
|
}
|
|
22
|
-
let m = s.match(/^::ffff:(\d{1,3}(?:\.\d{1,3}){3})
|
|
22
|
+
let m = s.match(/^::ffff:(\d{1,3}(?:\.\d{1,3}){3})(?::\d+)?$/i)
|
|
23
23
|
if (m) {
|
|
24
24
|
s = m[1]
|
|
25
25
|
}
|
|
26
26
|
return s
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
//檢查origin(
|
|
29
|
+
//檢查origin或標頭值(如'ip1, ip2', 'for=1.2.3.4;proto=https')內是否含有指定IP, 以IP可用字元之連續段切token後逐一正規化精確比對
|
|
30
30
|
function originHasIp(origin, ip) {
|
|
31
31
|
if (ip === '') {
|
|
32
32
|
return false
|
|
33
33
|
}
|
|
34
|
-
return String(origin).split(
|
|
34
|
+
return String(origin).split(/[^0-9a-fA-F:.[\]]+/).map((v) => normalizeIp(v)).indexOf(ip) >= 0
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
|
package/toolg/gDistRollup.mjs
CHANGED