File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
packages/web/src/pages/api Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ async function scriptPostHandler(
5353 if ( ( ! _id && userScriptCount >= 5 ) || ( _id && userScriptCount >= 7 ) ) {
5454 return res . status ( 400 ) . json ( { err : 'user script count is over 5' } )
5555 }
56- if ( String ( value ) . match ( / r e q u i r e | i m p o r t | f e t c h | g l o b a l | p r o c e s s / g) ) {
56+ if ( String ( value ) . match ( / r e q u i r e \( \S + \) | i m p o r t . + f r o m . + | f e t c h \( \S + \) | g l o b a l | p r o c e s s / g) ) {
5757 return res . status ( 400 ) . json ( { err : 'cannot contain "require" / "import" / "fetch" / "global" / "process" inside eraser script.' } )
5858 }
5959
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ async function _postHandler(
3535 return res . status ( 400 ) . json ( { err : 'please check input value and script length.' } ) ;
3636 }
3737 // customScript safe check
38- if ( String ( customScript ) . match ( / r e q u i r e | i m p o r t | f e t c h | g l o b a l | p r o c e s s / g) ) {
38+ if ( String ( customScript ) . match ( / r e q u i r e \( \S + \) | i m p o r t . + f r o m . + | f e t c h \( \S + \) | g l o b a l | p r o c e s s / g) ) {
3939 return res . status ( 400 ) . json ( { err : 'cannot contain "require" / "import" / "fetch" / "global" / "process" inside custom script.' } )
4040 }
4141 console . log ( 'task js log' )
You can’t perform that action at this time.
0 commit comments