产物下载客户端不再跟随跳转
- 产物地址来自 provider 响应,禁止 reqwest 自动跳转以防 SSRF - 需要跳转的地址会以非成功状态显式暴露,不再由服务端静默代发
This commit is contained in:
@@ -25,6 +25,9 @@ impl TripoProviderClient {
|
||||
// 这里只限制「多久没有进展」:连接用 connect_timeout,传输过程用 read_timeout。
|
||||
.connect_timeout(settings.request_timeout)
|
||||
.read_timeout(settings.request_timeout)
|
||||
// 产物地址由 provider 响应给出:不跟随跳转,避免被重定向到内网 / 云元数据地址。
|
||||
// 真的需要跳转的 CDN 会以非成功状态暴露出来,而不是被服务端静默代发请求。
|
||||
.redirect(reqwest::redirect::Policy::none())
|
||||
.build()
|
||||
.map_err(|error| TripoError::Request {
|
||||
message: format!("failed to build artifact download client: {error}"),
|
||||
|
||||
Reference in New Issue
Block a user