Skip to content

Commit 9606eda

Browse files
committed
telemetry occlusion path
1 parent c99f2e3 commit 9606eda

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

script/service/telemetry.lua

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,28 @@ local function pushVersion(link)
5959
))
6060
end
6161

62+
local function occlusionPath(str)
63+
return str:gsub('[^"\r\n]+', function (chunk)
64+
if not chunk:find '[/\\]' then
65+
return
66+
end
67+
local newStr, count = chunk:gsub('.+([/\\]script[/\\])', '***%1')
68+
if count > 0 then
69+
return newStr
70+
elseif chunk:find '^%u:'
71+
or chunk:sub(1, 1) == '/' then
72+
return '***'
73+
end
74+
end)
75+
end
76+
6277
local function pushErrorLog(link)
63-
if not log.firstError then
78+
local err = log.firstError
79+
if not err then
6480
return
6581
end
66-
local err = log.firstError
6782
log.firstError = nil
83+
err = occlusionPath(err)
6884
send(link, string.pack('zzzz'
6985
, 'error'
7086
, token

0 commit comments

Comments
 (0)