Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
徽霖
Vscode
提交
b7721220
V
Vscode
项目概览
徽霖
/
Vscode
通知
9
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
Vscode
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b7721220
编写于
3月 29, 2018
作者:
R
Ramya Achutha Rao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "Remove file paths from telemetry data"
This reverts commit
21bfdd43
.
上级
7f3f77b5
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
19 deletion
+14
-19
src/vs/platform/telemetry/common/telemetryService.ts
src/vs/platform/telemetry/common/telemetryService.ts
+14
-19
未找到文件。
src/vs/platform/telemetry/common/telemetryService.ts
浏览文件 @
b7721220
...
...
@@ -37,8 +37,7 @@ export class TelemetryService implements ITelemetryService {
private
_userOptIn
:
boolean
;
private
_disposables
:
IDisposable
[]
=
[];
private
_cleanupPatterns
:
RegExp
[]
=
[];
private
readonly
fileRegex
=
process
.
platform
===
'
win32
'
?
/
[
a-z,A-Z
]
:
(\\?[\\\/]\w
+
)
+/g
:
/
(\/\w
+
)
+/g
;
private
_cleanupPatterns
:
[
RegExp
,
string
][]
=
[];
constructor
(
config
:
ITelemetryServiceConfig
,
...
...
@@ -49,11 +48,18 @@ export class TelemetryService implements ITelemetryService {
this
.
_piiPaths
=
config
.
piiPaths
||
[];
this
.
_userOptIn
=
typeof
config
.
userOptIn
===
'
undefined
'
?
true
:
config
.
userOptIn
;
// static cleanup pattern for: `file:///DANGEROUS/PATH/resources/app/Useful/Information`
this
.
_cleanupPatterns
=
[
/file:
\/\/\/
.*
?\/
resources
\/
app
\/
/gi
];
// static cleanup patterns for:
// #1 `file:///DANGEROUS/PATH/resources/app/Useful/Information`
// #2 // Any other file path that doesn't match the approved form above should be cleaned.
// #3 "Error: ENOENT; no such file or directory" is often followed with PII, clean it
this
.
_cleanupPatterns
.
push
(
[
/file:
\/\/\/
.*
?\/
resources
\/
app
\/
/gi
,
''
],
[
/file:
\/\/\/
.*/gi
,
''
],
[
/ENOENT: no such file or directory.*
?\'([^\']
+
)\'
/gi
,
'
ENOENT: no such file or directory
'
]
);
for
(
let
piiPath
of
this
.
_piiPaths
)
{
this
.
_cleanupPatterns
.
push
(
new
RegExp
(
escapeRegExpCharacters
(
piiPath
),
'
gi
'
)
);
this
.
_cleanupPatterns
.
push
(
[
new
RegExp
(
escapeRegExpCharacters
(
piiPath
),
'
gi
'
),
''
]
);
}
if
(
this
.
_configurationService
)
{
...
...
@@ -121,21 +127,10 @@ export class TelemetryService implements ITelemetryService {
private
_cleanupInfo
(
stack
:
string
):
string
{
const
m
=
stack
.
match
(
this
.
fileRegex
);
if
(
!
m
)
{
return
stack
;
}
// remove file paths that do not match the cleanup patterns
m
.
forEach
(
x
=>
{
if
(
this
.
_cleanupPatterns
.
every
(
pattern
=>
!
pattern
.
test
(
x
)))
{
stack
=
stack
.
replace
(
x
,
''
);
}
});
// sanitize with configured cleanup patterns
for
(
let
regexp
of
this
.
_cleanupPatterns
)
{
stack
=
stack
.
replace
(
regexp
,
''
);
for
(
let
tuple
of
this
.
_cleanupPatterns
)
{
let
[
regexp
,
replaceValue
]
=
tuple
;
stack
=
stack
.
replace
(
regexp
,
replaceValue
);
}
return
stack
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录