feat: workerize external generation
This commit is contained in:
@@ -161,10 +161,9 @@ fn normalize_creation_entry_announcement_banner_value(
|
||||
);
|
||||
}
|
||||
|
||||
let banner = serde_json::from_value::<CreationEntryEventBannerResponse>(Value::Object(
|
||||
object.clone(),
|
||||
))
|
||||
.map_err(|error| format!("第 {} 条公告对象非法:{error}", index + 1))?;
|
||||
let banner =
|
||||
serde_json::from_value::<CreationEntryEventBannerResponse>(Value::Object(object.clone()))
|
||||
.map_err(|error| format!("第 {} 条公告对象非法:{error}", index + 1))?;
|
||||
normalize_creation_entry_event_banner_response(index, banner)
|
||||
}
|
||||
|
||||
@@ -327,10 +326,7 @@ fn normalize_banner_html_code(
|
||||
}
|
||||
let lower_html_code = html_code.to_ascii_lowercase();
|
||||
if lower_html_code.contains("<script") || lower_html_code.contains("javascript:") {
|
||||
return Err(format!(
|
||||
"第 {} 条 HTML 公告含有不允许的脚本代码",
|
||||
index + 1
|
||||
));
|
||||
return Err(format!("第 {} 条 HTML 公告含有不允许的脚本代码", index + 1));
|
||||
}
|
||||
|
||||
Ok(Some(html_code))
|
||||
|
||||
Reference in New Issue
Block a user