带地址响应体的过滤改成大小写不敏感
- server-rs/crates/platform-tripo/src/common/error.rs:body_snippet 先整串转小写再匹配 http:// 与 https://,`HTTPS://…` 这类大小写变体不再绕过过滤,签名 URL 不会被带进持久化的任务错误信息
This commit is contained in:
@@ -332,7 +332,10 @@ fn request_failure_message(
|
||||
/// 去掉首尾空白、截断,并挡掉疑似带地址的响应体。
|
||||
fn body_snippet(body: &str) -> Option<String> {
|
||||
let body = body.trim();
|
||||
if body.is_empty() || body.contains("http://") || body.contains("https://") {
|
||||
// 大小写不敏感:`HTTPS://…` 这类写法同样是带地址的响应体,放过去就把签名 URL
|
||||
// 带进了任务错误信息。这条路径不在热点上,整串转小写即可。
|
||||
let lowered = body.to_ascii_lowercase();
|
||||
if body.is_empty() || lowered.contains("http://") || lowered.contains("https://") {
|
||||
return None;
|
||||
}
|
||||
let mut chars = body.chars();
|
||||
|
||||
Reference in New Issue
Block a user