This commit is contained in:
Benjamin Toby
2024-11-18 10:59:12 +01:00
parent 5d56d41624
commit ebb6141ec5
4 changed files with 19 additions and 35 deletions
+1 -15
View File
@@ -41,21 +41,6 @@ async function localGet({ options, dbSchema }) {
const tableName = options?.tableName ? options.tableName : undefined;
const dbFullName = process.env.DSQL_DB_NAME || "";
/**
* Input Validation
*
* @description Input Validation
*/
if (
typeof query == "string" &&
(query.match(
/^alter|^delete|information_schema|databases|^create/i
) ||
!query.match(/^select|^\( ?select/i))
) {
return { success: false, msg: "Wrong Input" };
}
/**
* Create new user folder and file
*
@@ -71,6 +56,7 @@ async function localGet({ options, dbSchema }) {
dbSchema,
tableName,
local: true,
readOnly: true,
});
if (error) throw error;
-19
View File
@@ -21,25 +21,6 @@ async function localPost({ options, dbSchema }) {
const { query, tableName, queryValues } = options;
const dbFullName = process.env.DSQL_DB_NAME || "";
/**
* Input Validation
*
* @description Input Validation
*/
if (
typeof query === "string" &&
query?.match(/^create |^alter |^drop /i)
) {
return { success: false, msg: "Wrong Input" };
}
if (
typeof query === "object" &&
query?.action?.match(/^create |^alter |^drop /i)
) {
return { success: false, msg: "Wrong Input" };
}
/**
* Create new user folder and file
*