validation: include script path in ScriptFlaggedIllegalKeyword
This commit is contained in:
parent
188fbd2a6d
commit
d3edb6b3da
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user