拒收带userinfo的产物地址
- TripoUrl::parse 原先只校验 scheme,带 user:password@ 的地址会被 Debug / redacted 原样打进日志 - 解析阶段直接拒绝 userinfo,产物地址不需要凭据
This commit is contained in:
@@ -43,6 +43,13 @@ impl TripoUrl {
|
||||
message: "URL must use http or https".into(),
|
||||
});
|
||||
}
|
||||
// 产物地址不需要凭据;userinfo 只会在日志与调试输出里泄漏账号信息,直接拒收。
|
||||
if !url.username().is_empty() || url.password().is_some() {
|
||||
return Err(TripoError::OutputSchema {
|
||||
task_id: "unknown".into(),
|
||||
message: "URL must not contain userinfo".into(),
|
||||
});
|
||||
}
|
||||
Ok(Self(url))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user