validation: include script path in ScriptFlaggedIllegalKeyword #32

Merged
Quaternions merged 1 commits from pr into staging 2025-03-26 23:24:39 +00:00

@ -31,7 +31,7 @@ fn hash_source(source:&str)->String{
#[allow(dead_code)]
#[derive(Debug)]
pub enum ValidateError{
ScriptFlaggedIllegalKeyword,
ScriptFlaggedIllegalKeyword(String),
ScriptBlocked(Option<submissions_api::types::ScriptID>),
ScriptNotYetReviewed(Option<submissions_api::types::ScriptID>),
ModelFileDownload(rbx_asset::cookie::GetError),
@ -115,7 +115,9 @@ impl Validator{
// check the source for illegal keywords
if source_has_illegal_keywords(source){
// immediately abort
return Err(ValidateError::ScriptFlaggedIllegalKeyword);
// grab path to offending script
let path=get_partial_path(&dom,script);
return Err(ValidateError::ScriptFlaggedIllegalKeyword(path));
}
// associate a name and policy with the source code
// policy will be fetched from the database to replace the default policy