Add more restrictions

This commit is contained in:
kwaroran
2025-04-28 16:45:06 +09:00
parent f2839e66bb
commit 6db9bd08f1

View File

@@ -236,6 +236,29 @@ export async function runLua(code:string, arg:{
} }
} }
if(!url.startsWith('https://')){
return {
status: 400,
data: "Only https requests are allowed"
}
}
const bannedURL = [
"https://realm.risuai.net",
"https://risuai.net",
"https://risuai.xyz"
]
for(const burl of bannedURL){
if(url.startsWith(burl)){
return {
status: 400,
data: "request to " + url + ' is not allowed'
}
}
}
//browser fetch //browser fetch
const d = await fetchNative(url, { const d = await fetchNative(url, {
method: "GET" method: "GET"